Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Silverlight
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>
Posted 30-Jul-12 20:15pm
v4
Comments
Tadit Dash at 31-Jul-12 2:25am
   
Please post your codes.
suganyass at 31-Jul-12 3:42am
   























<Button HorizontalAlignment="Right" Height="30" Width="80" Content="Logout" Margin="5" Click="Logout_Button_Click" />

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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...
  Permalink  
v2
Comments
suganyass at 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 at 31-Jul-12 5:54am
   
Cant you do that with a simple Z-index?
suganyass at 31-Jul-12 6:05am
   
ya it works with Z-index. Thanks U... :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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

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

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 BillWoodruff 173
3 PIEBALDconsult 160
4 CPallini 155
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100