Silverlight navigation example - grouping gui controls in another assembly
I created a Silverlight Navigation application.
My MainPage XAML contains the basic navigation information: <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="/About" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/About.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
Now I don't like the fact that the Views (Controls) are in the same assembly and I want to give the project a bit more structure and move all the Views (Controls) in a separate assembly (e.g. Gui_Layer).
Now what are steps to be taken to make the MainPage aware that the Abo开发者_StackOverflowut page (for example) has moved from the current assembly to another assembly ?
I want the navigation to look for controls not in "currentAssembly/Views/" but in "Gui_Layer/Views".
Thanks in advance
In Silverlight 4 you can use a custom content loader that you can enable multi assembly view loading. The interface is INavigationContentLoader
.
http://blogs.msdn.com/b/dphill/archive/tags/helix/
http://www.davidpoll.com/2009/11/30/opening-up-silverlight-4-navigation-introduction-to-inavigationcontentloader/
精彩评论