Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want that user control(menuUserControl) should be seen on top of window as menu item ,calling from menu button.
given below main window code

HTML
<window 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xml:lang="en-US"
	xmlns:abc="clr-namespace:abc"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:local="clr-namespace:abc"
	x:Class="abc.Window1"
	x:Name="Window"
	Title="abc">
    <border>
        <border>
            <grid x:name="LayoutRoot" xmlns:x="#unknown">
                    <dockpanel>
                    <abc:menuusercontrol1 visibility="Visible" margin="0,31.096,109.8,-29.096" x:name="menuUserControl1" xmlns:abc="#unknown" />
                    <grid dockpanel.dock="Top">
                            <grid>
                                <grid.columndefinitions>
                                    <columndefinition width=".300*" />
                                    <columndefinition width=".700*" />
                                </grid.columndefinitions>
                                <Label DockPanel.Dock="Top"  
                                    Grid.Column="1"
                                     >abc
                                </Label>
                                <Button Grid.Column="1" >
                                    r
                                </Button>
                                <Button Grid.Column="1"/>
                                               <Button Grid.Column="1">                          
                        </grid>
                            <grid>
                                <grid.columndefinitions>
                                    <columndefinition width="59*" />
                                    <columndefinition width="634*" />
                                    <columndefinition width="85*" />
                                </grid.columndefinitions>
                                <Button>
           
                        Grid.Column="2">
                                    ?
                                </Button>
                            </grid>
                          
                            <Button>
                                <Image/>
                            
                             
                            </Button>
                       
                        </grid>
                     
                        <abc:mystatusbarcontrol dockpanel.dock="Bottom" xmlns:abc="#unknown" />
                        
                        <dockpanel dockpanel.dock="Left">
            
                            <border dockpanel.dock="Left">
                         
                                <grid>
                                    <grid.rowdefinitions>
                                        <rowdefinition height=".060*" />
                                        <rowdefinition height=".060*" />
                                        <rowdefinition height=".600*" />
                                        <rowdefinition height=".165*" />
                                        <rowdefinition height=".08*" />
                                    </grid.rowdefinitions>
                                    <border grid.row="0"> 
                                        <dockpanel> 
                                            <togglebutton>
                                          DockPanel.Dock="Right" >
                                                <Label>
                                                    <Label>
                                                        <Label.RenderTransform>
                                                            <rotatetransform angle="16" centerx="29" centery="0"></rotatetransform>
                                                        </Label.RenderTransform>
                                                    </Label>
                                                </Label>
   
                            

                                            </togglebutton>
                   
                                            <textblock>
                        </textblock></dockpanel>
                                    </border>
                                    <border grid.row="1">

                                        <dockpanel>
                                            <textblock />
                        </dockpanel>
                                    </border>
                                    <scrollviewer grid.row="2">
                                        <stackpanel>
                                        </stackpanel>
                                    </scrollviewer>
                                    <grid grid.row="3">
                                        <grid.rowdefinitions>
                                            <rowdefinition />
                                            <rowdefinition />
                                            <rowdefinition />
                                        </grid.rowdefinitions>
                                        <Button Grid.Row="0">
                                            <stackpanel>
                                                <textblock>
                                                    iagnosis
                                                </textblock>
  						    </stackpanel>
                                        </Button>
                                        <Button Grid.Row="1">
                                            <stackpanel>
                                                <textblock>
                                                    <underline>F</underline>irmware
                                                </textblock>
  						    </stackpanel>
                                        </Button>
                                        <Button  Grid.Row="2"> 
                                            <stackpanel>
                                                <textblock>
                                                    Reader <underline>S</underline>ettings
                                                </textblock>
  						    </stackpanel>
                                        </Button>
                                    </grid>
                                    <border grid.row="4">
                                        <Image  />
                                 
                                    </border>
                                    <abc:mysidebarcontrol xmlns:abc="#unknown">
                         Grid.Row="0" Grid.RowSpan="5">
                                    </abc:mysidebarcontrol>
                                </grid>
                            </border>
                                      <abc:resizingcustomcontrol dockpanel.dock="Left" xmlns:abc="#unknown">
                                <abc:resizingcustomcontrol.resources>
                                                    <border />
                                </abc:resizingcustomcontrol.resources>
                            </abc:resizingcustomcontrol>
            
                            <border grid.column="1" dockpanel.dock="Right">
                                <grid name="contentGrid">
                                    <Image Grid.Row="0" Grid.RowSpan="2" ></Image>
                                </grid>
                            </border>
                        </dockpanel>
                    </dockpanel>
                    <!-- Top PANEL -->
                
            </grid> 
        </border>
    </border>   
</window>
Posted
Updated 3-Oct-11 6:54am
v2
Comments
Sergey Alexandrovich Kryukov 3-Oct-11 13:57pm    
Not a question!
--SA

1 solution

Hi,

allthough your provided code is almost unusable (it has nothing to do with XAML, where "border", "grid" and most of the other elements you listed don't exist), the solution to your wish ("menuUserControl should be seen on top") is to set
HTML
DockPanel.Dock="Top"
in the definition of menueusercontrol1.

Unfortunately I have no idea, what you mean by "calling from menu button" as none of your buttons has a command or code behind and controls aren't called. So maybe you elaborate a bit on that, if there still is a problem.

Cheers
Jürgen
 
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