MainWindow.xaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <Window x:Class="WpfApp2.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:WpfApp2"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <DataGrid
  10. x:Name="phonesGrid"
  11. AutoGenerateColumns="False"
  12. HorizontalGridLinesBrush="DarkGray"
  13. RowBackground="LightGray"
  14. AlternatingRowBackground="White">
  15. <DataGrid.Items>
  16. <local:Phone
  17. Title="iPhone 6S"
  18. Company="Apple"
  19. Price="54990" />
  20. <local:Phone
  21. Title="Lumia 950"
  22. Company="Microsoft"
  23. Price="39990" />
  24. <local:Phone
  25. Title="Nexus 5X"
  26. Company="Google"
  27. Price="29990" />
  28. </DataGrid.Items>
  29. <DataGrid.Columns>
  30. <DataGridTextColumn
  31. Header="Модель"
  32. Binding="{Binding Path=Title}"
  33. Width="90" />
  34. <DataGridHyperlinkColumn
  35. Header="Компания"
  36. Binding="{Binding Path=Company}"
  37. Width="80" />
  38. <DataGridTextColumn
  39. Header="Цена"
  40. Binding="{Binding Path=Price}"
  41. Width="50" />
  42. </DataGrid.Columns>
  43. </DataGrid>
  44. </Window>