在silverlight中的导航框架 [英] Navigation Frame in silverlight
本文介绍了在silverlight中的导航框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个菜单栏,下面是我有一个框架控件来浏览我的页面,但问题是当我运行项目菜单项目显示回框架而不是正面和当我放置它上面的光标就消失了。所以任何人都可以帮助我如何在框架布局前显示菜单栏。
这是我的XAML代码
I''ve a menu bar and below to that I''ve a frame control to navigate my pages, but the problem is when i run the project menu items displaying back to the frame not front side and when i place the cursor on it they disappearing. So any one help me how can i display menu bar in front of frame layout.
This is my XAML Code
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="500"/>
</Grid.RowDefinitions>
<mn:MenuBar Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<mn:MenuBarItem MenuText="Admissions">
<mn:MenuItem MenuText="New" x:Name="mnPgAdmisn" Click="mnPgAdmisn_Click"/>
<mn:MenuItem MenuText="Manage" />
</mn:MenuBarItem>
<mn:MenuBarItem MenuText="Students" DataContext="{Binding}">
<mn:MenuItem MenuText="Under Graduate" />
<mn:MenuItem MenuText="Post Graduate" x:Name="MnPGStudent" Click="MnPGStudent_Click" />
</mn:MenuBarItem>
<mn:MenuBarItem MenuText="Departments" >
<mn:MenuItem MenuText="New" />
<mn:MenuItem MenuText="Manage" />
</mn:MenuBarItem>
<mn:MenuBarItem MenuText="Transport" >
<mn:MenuItem MenuText="Routes" />
</mn:MenuBarItem>
</mn:MenuBar>
<Button HorizontalAlignment="Right" Height="30" Width="80" Content="Logout" Margin="5" Click="Logout_Button_Click" />
<navigation:Frame Grid.Row="1" x:Name="nvContainer" HorizontalAlignment="Stretch" removed="#656D78" Width="Auto"/>
</Grid>
推荐答案
替换为:
Replace this:
<button horizontalalignment="Right" height="30" width="80" content="Logout" margin="5" click="Logout_Button_Click" />
<navigation:frame grid.row="1" x:name="nvContainer" horizontalalignment="Stretch" removed="#656D78" width="Auto" xmlns:x="#unknown" xmlns:navigation="#unknown" />
这个:
With this:
<stackpanel grid.row="1">
<Button HorizontalAlignment="Right" Height="30" Width="80" Content="Logout" Margin="5" Click="Logout_Button_Click" />
<navigation:frame x:name="nvContainer" horizontalalignment="Stretch" removed="#656D78" width="Auto" xmlns:x="#unknown" xmlns:navigation="#unknown" />
</stackpanel>
它应该工作......
And it should work...
我不知道原因,我用这个方法解决了问题
I do not know the reason, I use this method and solved the problem
<Grid x:Name="LayoutRoot" ShowGridLines="True" MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<toolkit:DockPanel Grid.Row="0" Canvas.ZIndex="3">
<Canvas>
<MENU:SLMenu HorizontalAlignment="Stretch"
Dock="Top" Name="Mnu" FlowDirection="RightToLeft"
VerticalAlignment="Stretch" FontWeight="ExtraBlack"
FontSize="12" FontFamily="Tahoma" />
</Canvas>
</toolkit:DockPanel>
<navigation:Frame Grid.Row="1" x:Name="MainFrame">
</navigation:Frame>
<!-- <Image Source="Images/1.jpg" Grid.Row="1" Height="Auto" Width="Auto" Name="image1" Stretch="Fill" /> -->
</Grid>
这篇关于在silverlight中的导航框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文