silverlightnavigationsilverlight-5.0

Navigating to a different assembly in Silverlight


I'm trying to navigate to a page located in a different assembly with no success.

I made an extremely simple Silverlight Navigation Application make my point:

My Project

I simply have a Hyperlink with:

NavigateUri="/PageClassLibrary;component/Pages/PageInLibrary.xaml"

In the calling page (MainPage.xaml in MainNavigationApp) I have a Frame with no UriMappings for now.

 <Grid x:Name="LayoutRoot">

      <navigation:Frame x:Name="ContentFrame"
                        Style="{StaticResource ContentFrameStyle}"
                        Navigated="ContentFrame_Navigated"
                        NavigationFailed="ContentFrame_NavigationFailed">
      </navigation:Frame>

      <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">

         <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">

            <HyperlinkButton x:Name="Link3"
                             Style="{StaticResource LinkStyle}"
                             NavigateUri="/PageClassLibrary;component/Pages/PageInLibrary.xaml"
                             TargetName="ContentFrame"
                             Content="page in a class library" />
         </StackPanel>

      </Grid>

    </Grid>

But when I run it, I get an error message saying that the page was not found:

Page not found: "/PageClassLibrary;component/Pages/PageInLibrary.xaml"

I even modified MainNavigationApp dependencies, checking depends on PageClassLibrary, but it didn't improve the outcome.

I ran out of ideas. Does anybody have a hint?

Here's thesolution:

https://skydrive.live.com/#cid=B79120F33F3A7A64&id=B79120F33F3A7A64%21105


Solution

  • AAAhhh!, the solution was there in front of my eyes. JUST ADD A REFERENCE TO THE ASSEMBLY. dah!