123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <Window x:Class="WpfApp2.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:WpfApp2"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <DataGrid
- x:Name="phonesGrid"
- AutoGenerateColumns="False"
- HorizontalGridLinesBrush="DarkGray"
- RowBackground="LightGray"
- AlternatingRowBackground="White">
- <DataGrid.Items>
- <local:Phone
- Title="iPhone 6S"
- Company="Apple"
- Price="54990" />
- <local:Phone
- Title="Lumia 950"
- Company="Microsoft"
- Price="39990" />
- <local:Phone
- Title="Nexus 5X"
- Company="Google"
- Price="29990" />
- </DataGrid.Items>
- <DataGrid.Columns>
- <DataGridTextColumn
- Header="Модель"
- Binding="{Binding Path=Title}"
- Width="90" />
- <DataGridHyperlinkColumn
- Header="Компания"
- Binding="{Binding Path=Company}"
- Width="80" />
- <DataGridTextColumn
- Header="Цена"
- Binding="{Binding Path=Price}"
- Width="50" />
- </DataGrid.Columns>
- </DataGrid>
- </Window>
|