Question

I'm creating a Silverlight 3.0 MVVM application using Silverlight.FX but my View is actually using the Silverlight navigation system, a Page. Following Nikhil's example, my View should derive from the Silverlight.FX Window class.

What's the best approach to making a Window that also supports the Page functionality or is there something that already does this?

Was it helpful?

Solution

Discovered the Page and PageFrame classes of Silverlight.FX. These classes have the same basic functionality as the Silverlight navigation types but with support for the binding I was looking for.

xmlns:fxnav="clr-namespace:SilverlightFX.UserInterface.Navigation;assembly=SilverlightFX"
...
<fxnav:PageFrame x:Name="_frame"
                 IsIntegratedWithBrowser="True"
                 DefaultUri="StartView"
                 HorizontalContentAlignment="Stretch"/>

I'm having trouble grabbing the parent container from the Pages' code-behind (unlike the Silverlight 3.0 Page) but I shouldn't need it once I remove the Click handler and fully switch to MVVM anyway.

OTHER TIPS

It is worth to mention that PageFrame's default PageLoader component automatically mapping all pages available. There is no way to use new UriMapping component from Silverlight 3 with SilverlightFX's PageFrame. So, if your page is named as MySilverlightPage.xaml (and corresponding page class has the same name), it will be available at "mysilverlight" address.

P.S. I decided to mention it, because it was not clear for me when I tried to use SilverlightFX first time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top