GridDefines a content modifier that can stretch and scale a single sub-element to fill up available space.
Why do we first introduce this control?ProgramUi layout is indispensable, so we will first introduce this control.
< Window X: Class = "Materialstorage. mainwindow" Xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation" Xmlns: x = "Http://schemas.microsoft.com/winfx/2006/xaml" Title = "Mainwindow" Height = "350" Width = "525" > < Grid > <! -- Here, the mesh is defined with three rows and one column. The first row is 20, the third row is 20, and the rest are adaptive. --> < Grid. rowdefinitions > < Rowdefinition Height = "20" > </ Rowdefinition > < Rowdefinition Height = "*" > </ Rowdefinition > < Rowdefinition Height = "20" > </ Rowdefinition > </ Grid. rowdefinitions > < Grid. columndefinitions > < Columndefinition Width = "*" > </ Columndefinition > </ Grid. columndefinitions > < Button Grid. Row = "0" > Button 1 </ Button > <! -- Here, you need to manually define the grid where the control is located. Otherwise, they will display the four values of margin by default 0, which correspond to the upper left and lower right. --> < Button Grid. Row = "1" Grid. Column = "0" Height = "30" Width = "60" Verticalalignment = "Center" Horizontalalignment = "Left" Margin = "20, 0, 0" > Button 2 </ Button > < Button Grid. Row = "2" > Button 3 </ Button > </ Grid > </ Window >