A comprehensive example of WPF layout
<window x:class= "Uniformgriddemo.mainwindow" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation "xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "xmlns:d=" HTTP://SCHEMAS.MICROSOFT.COM/EXPRESSION/BL end/2008 "xmlns:mc=" http://schemas.openxmlformats.org/markup-compatibility/2006 "xmlns:local=" Clr-namespace: Uniformgriddemo "mc:ignorable=" D "title=" MainWindow "height=" "Width=" "> <dockpanel width=" Au To "height=" Auto "lastchildfill=" True > <!--top Menu area--<menu width= "Auto" height= "background=" "Lightgray" dockpanel.dock= "Top" > <!--File menu item--<menuitem header= "Files" > <menuitem header= "Save"/> <Separator/> <menuitem header= "Exit"/> </MenuItem> <!--about menu items--<menuitem header= Help > <menuite M header= "about this product"/> </MenuItem> </Menu> <!--status Bar--<stackpanel width= "Auto" height= "Back" Ground= "Lightgray" orientation= "horizontal" dockpanel.dock= "Bottom" > <label width= "Auto" height= "Auto" Co ntent= "status bar" fontfamily= "Arial" fontsize= "/> </StackPanel> <!--left--> <stackpane L width= "height=" Auto "background=" Gray "dockpanel.dock=" left "> <button margin=" ten "width=" Auto "Hei ght= "content=" navigation bar/> <button margin= "Ten" width= "Auto" height= "" content= "navigation bar"/> <b Utton margin= "width=" Auto "height=" content= "navigation bar/> </StackPanel> <!--right--> <grid width= "Auto" height= "Auto" background= "white" > <Grid.ColumnDefinitions> <co Lumndefinition width= "*"/> <columndefinition width= "*"/> </grid.columndefinitions> ; <grid.rowdefinitions> <rowdefinition height= "*"/> <rowdefinition height= "*"/> </Grid.RowDefinitions> <rectangle fill= "Gray" margin= "10,10,10,10" grid.row= "0" grid.column= "0"/&G T <rectangle fill= "Gray" margin= "10,10,10,10" grid.row= "0" grid.column= "1"/> <rectangle Fill= "Gray" Marg In= "10,10,10,10" grid.row= "1" grid.column= "0"/> <rectangle fill= "Gray" margin= "10,10,10,10" Grid.Row= "1" grid.column= "1"/> </Grid> </DockPanel></Window>
Run the result as
A comprehensive example of WPF layout