I think that maybe I had problems with its wording (new to silverlight and its control), but the general goal and problem is this:
I created a silverlight application with "MainPage.xaml". Inside the page there is a grid that has two main controls: navigation: Frame [we can call this ContentFrame, as Microsoft did in our demo versions], and another control that I created, consisting of a banner on the top of the page and a simple one navigation [for the sake of this solution it can be called BannerControl]
BannerControl has links at this point (or should point to) to different pages of my project. They click the link in the banner, and MainPage then fills the ContentFrame (or I hope). This is not true.
My first thought is how the controls are connected, and BannerControl is a child and maybe not seeing a NavigationFrame. Maybe this is my grossly inept interpretation of how this should work, which gives me problems, but in any case I'm in the road block.
Can someone give me recommendations on how I can make links work?
MainPage.xaml:
<Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootStyle}">
<Grid x:Name="ContentRoot" Style="{StaticResource ContentRootStyle}">
<StackPanel>
<local:NavigationBar/>
<navigation:Frame x:Name="ContentFrame" Source="/Pages" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed" Margin="25,5">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Pages/Welcome.xaml"/>
<uriMapper:UriMapping Uri="/IT/{pageName}" MappedUri="/pages/IT/{pageName}.xaml"/>
<uriMapper:UriMapping Uri="/RM/{pageName}" MappedUri="/pages/IT/{pageName}.xaml"/>
<uriMapper:UriMapping Uri="/RSG/{pageName}" MappedUri="/pages/IT/{pageName}.xaml"/>
<uriMapper:UriMapping Uri="/RSM/{pageName}" MappedUri="/pages/IT/{pageName}.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/pages/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</StackPanel>
</Grid>
</Grid>
Links in the banner:
<StackPanel x:Name="NavBarSubNavRSG" Style="{StaticResource NavBarSubNavStyle}"
Visibility="Collapsed">
<Rectangle Style="{StaticResource NavBarSubNavPadStyle}"/>
<HyperlinkButton x:Name="NavBarSubRSGOneLink" Content="RSG One"
Style="{StaticResource NavBarSubNavLinkStyle}"/>
<Rectangle Style="{StaticResource NavBarSubNavRectStyle}"/>
<HyperlinkButton x:Name="NavBarSubRSGTwoLink" Content="RSG Two"
Style="{StaticResource NavBarSubNavLinkStyle}"/>
<Rectangle Style="{StaticResource NavBarSubNavRectStyle}"/>
<HyperlinkButton x:Name="NavBarSubRSGThreeLink" Content="RSG Three"
Style="{StaticResource NavBarSubNavLinkStyle}"/>
<Rectangle Style="{StaticResource NavBarSubNavRectStyle}"/>
<HyperlinkButton x:Name="NavBarSubRSGFourLink" Content="RSG Four"
Style="{StaticResource NavBarSubNavLinkStyle}"/>
</StackPanel>
source
share