Click here to Skip to main content
16,017,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

XML
<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>
Posted
v4
Comments
Please post your codes.
suganyass 31-Jul-12 3:42am    
<grid x:name="LayoutRoot">
<grid.rowdefinitions>
<rowdefinition height="40">
<rowdefinition height="500">


<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 menutext="Students" datacontext="{Binding}">
<mn:menuitem menutext="Under Graduate">
<mn:menuitem menutext="Post Graduate" x:name="MnPGStudent" click="MnPGStudent_Click">

<mn:menubaritem menutext="Departments">
<mn:menuitem menutext="New">
<mn:menuitem menutext="Manage">

<mn:menubaritem menutext="Transport">
<mn:menuitem menutext="Routes">


<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">

Replace this:
XML
<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:

XML
<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...
 
Share this answer
 
v2
Comments
suganyass 31-Jul-12 5:46am    
Thanks for you reply, But I need to display menu bar in front of Frame not in top.
Kenneth Haugland 31-Jul-12 5:54am    
Cant you do that with a simple Z-index?
suganyass 31-Jul-12 6:05am    
ya it works with Z-index. Thanks U... :)
I do not know the reason, I use this method and solved the problem

XML
<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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900