Home All Groups Group Topic Archive Search About

XAML: How to dispay External XAML grid

Author
10 Nov 2006 9:26 PM
Chris Moore
Consider the following Scenario:

I have a xaml project which contains 3 grids defined in separate XAML
files, e.g.,


Grid1.xaml
-----------------------
<Grid x:Class="Grid1">
     //content
</Grid>


Grid2.xaml
-----------------------
<Grid x:Class="Grid2">
     //content
</Grid>


Grid3.xaml
-----------------------
<Grid x:Class="Grid3">
     //content
</Grid>


Now, How does one construct a page (in XAML) that displays these grids
in, say, a
Stack Panel? Programatically, from within the code-behind for the page,
one would simply write

void AddGrids()
{
   myStackPanel.Children.Add(new Grid1());
   myStackPanel.Children.Add(new Grid2());
   myStackPanel.Children.Add(new Grid3());
}

But how would one accomplish this declaratively in XAML?

Thanks.

Thanks

AddThis Social Bookmark Button