silverlightnavigationprismcomposite-application

Utilizing Frames/Pages and Composite Application Guidance (Prism) in Silverlight Solution


Is there any way to use pages/frames in a Silverlight Composite Application?

I have previously created a Silverlight Application that utilizes System.Windows.Controls.Navigation.Frame and System.Windows.Controls.Pages. Here is the key piece of code:

<navigation:Frame x:Name="FrameMain" Source="/Pages/StartPage.xaml"/>

I am trying to integrate the project into a Composite Application Guidance solution. Everything seems to be going fine until it attempts to load the frame source. Then I get:

An unhandled exception ('Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.InvalidOperationException: No XAML was found at the location '/Pages/StartPage.xaml'.

When I remove the "Source" attribute from the XAML the Region loads up fine (albeit without a piece of content).

I'm new to Composite Apps, Silverlight, and XAML; but I can understand that the application is looking for the Page at that specific location, which doesn't exist in the main application (and only exists in the specific project).

Is there anyway that I can load up the frame programatically? Or is there another solution to get those pages to load up?


Solution

  • I simply replaced the frame with a ContentControl. I changed the links within my pages to set the ContentControl.Content property to the link's related page.