Search code examples
c#silverlightmefnavigation-framework

Is Navigation to Objects (NOT URIs) with Navigation Framework in Silverlight (with MEF) possible?


Here is my situation. I have an app that is composed almost entirely using MEF. All of the application's UI is downloaded using MEF's DeploymentCatalog. Navigation was performed simply by swapping out content areas in the main app from downloaded xaps. Fine. But I decided it would be nice to provide navigation history on the browser. So I want to roll in the Navigation Framework (Frame specifically).

Here is the problem, I can't seem to use the Frame because it requires you to pass a URI. Because my assemblies are downloaded and stored in the CompositionContainer, the normal format of the URI for assembly reference doesn't work (i.e. /{assembly};component/{XAML Path} doesn't work)

In just .NET (not silverlight) you can navigate to an object on the Frame by passing the content. This is what I would like to do in silverlight but the method doesnt' appear.

Does anyone have any suggestions on how I could support navigation without using a URI? And without restructuring the entire application (i.e. I know the navigation framework now supports the NavigationContentLoader but this would require me to restructure my application and doesn't allow me to easily manage other classes that get composed through MEF that don't have UI components)

And thoughts?


Solution

  • It doesn't appear that you can. I got around this problem by using a collapsed navigation frame that allows me to use the navigation properties in the browser, but then I manually control the display of the content.