Создаем новый проект WPF Application... и добавим код в файле MainWindow.xaml
<Window x:Class="WpfApp1.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/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid ShowGridLines="True" Margin="15 15" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="241*"/>
<ColumnDefinition Width="314*"/>
<ColumnDefinition Width="237*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="210*"/>
<RowDefinition Height="209*"/>
</Grid.RowDefinitions>
<Label Content="Hello World!"
HorizontalAlignment="Left"
Margin="72,95,0,0"
VerticalAlignment="Top"/>
<Button Content="My Button"
Grid.Column="1"
HorizontalAlignment="Left"
Margin="110,95,0,0"
VerticalAlignment="Top"
Width="75"/>
<TextBox Grid.Column="2"
HorizontalAlignment="Left"
Height="23"
Margin="66,95,0,0"
TextWrapping="Wrap"
Text="My TextBox"
VerticalAlignment="Top"
Width="120"/>
</Grid>
</Window>
Создаем новый проект WPF Application... и добавим код в файле MainWindow.xaml
<Window x:Class="WpfApp1.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/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="340" />
<ColumnDefinition Width="600" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="70"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<!-- header -->
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Background="lightgray">
<Label Content="Hello Top"/>
</StackPanel>
<!-- left panel -->
<StackPanel Grid.Column="0" Grid.Row="1" Background="lightgreen">
<Label Content="Hello1" />
</StackPanel>
<!-- right panel -->
<StackPanel Grid.Column="1" Grid.Row="1" Background="lightyellow">
<StackPanel Background="lightblue" Height="200">
<Label Content="Hello2" />
</StackPanel>
<StackPanel Background="MediumSlateBlue" Height="300">
<Label Content="Hello3" />
</StackPanel>
</StackPanel>
</Grid>
</Window>