views:

56

answers:

2

Basically what I am asking here is how to display a XAML page within a tab control that is part of another XAML page. Or, for that matter, if this is even possible. I want to be able to click a button on page1 and be able to view the page2 from within a tab control that is on page1.

Would this be something to be handled within a Frame control? Or something different? Or is there a better approach to this altogether?

I am programming in Silverlight-4.0, C#-4.0 from within Visual Studio 2010.

Thank you so much!

+1  A: 

You can check the Silverlight Navgition Framework You can show "frames" inside your control. It also support deep linking, which is the killer feature here..

This is a very good intro - by Tim Heuer

Svetlozar Angelov
This should help, thank you!
AmbiguousX
+1  A: 

You could use the navigation framework, but that isn't really what you're asking. You want to know how to put the contents of one file into a tab, while the contents of another file are in the other tab.

A page in silverlight is simply a user control. You can put a usercontrol into the tab just like you would any other control. In order to use a local usercontrol in another xaml file, you'll need to do the following:

Add this to the root element of the page containing the tabs:

xmlns:local="clr-reference.MyApplicationNamespace"

Then you can add this to add the control into the tab:

<local:usercontrolname name="mycontrol" someproperty="value" />
Gabriel McAdams
Yes, I believe this is what I was wanting. Question though, after doing this, would this allow me to add more pages to the same tab in the same fashion?
AmbiguousX
Because you are just adding a usercontrol to your page, you can add as many as you want. Think of it less as adding another page to your page, and more as adding a control to your page.
Gabriel McAdams
right, awesome. Thank you so much!
AmbiguousX