Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit call multiple xaml in a page
3 replies. Latest Post by RWyman on August 13, 2009.
(0)
purushot...
Member
0 points
9 Posts
08-13-2009 9:40 AM |
Hi to all,Thanks in advance,
How to call multiple xaml (in one project ) in a page?
preishuber
Contributor
3570 points
655 Posts
08-13-2009 9:43 AM |
each xaml page is a usercontrol
create a instance and add it to Child collection
(like in app.xaml.cs is done)
08-13-2009 9:54 AM |
Thanks for u r reply,
I am new to silver light.please give me any sample of above requirement.
RWyman
16 points
13 Posts
08-13-2009 10:24 AM |
What are you tring to do with the xaml pages you are calling? I am relatively new to Silverlight as well, so I only know a couple of ways to do this. But if you are trying to create a popup you could do something like:MyPopup.Child = new MySecondXamlPage(); MyPopup.IsOpen = true;
Or you could load a new xaml page into a ContentControl by doing something like:MyContentControl.Content = new MySecondXamlPage();Or if you are using Silverlight 3.0 you could use a naviagation frame. I don't have any experience with this, so I cannot give you an example of how to use this.
http://silverlight.net/learn/learnvideo.aspx?video=56933 also shows how to change xaml pages.
Basically if you want to load a xaml page into an exsiting one you just need to create a new instance of it and store it in something, such as the child element of a popup or the content element of a content control.