MainWindow.xaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <Window x:Class="wpf_template.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:wpf_template"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <Grid ShowGridLines="True">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="auto"/>
  12. <RowDefinition />
  13. <RowDefinition Height="auto"/>
  14. </Grid.RowDefinitions>
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="200"/>
  17. <ColumnDefinition/>
  18. </Grid.ColumnDefinitions>
  19. <!-- типа логотип компании -->
  20. <Image
  21. Source="img/1.jpg"
  22. Grid.RowSpan="2" HorizontalAlignment="Right"/>
  23. <DataGrid
  24. Grid.Row="1"
  25. Grid.Column="1"
  26. CanUserAddRows="False"
  27. AutoGenerateColumns="False"
  28. ItemsSource="{Binding PeopleList}">
  29. <DataGrid.Columns>
  30. <DataGridTextColumn
  31. Header="Имя"
  32. Binding="{Binding Name}"/>
  33. <DataGridTextColumn
  34. Header="Возраст"
  35. Binding="{Binding Age}"/>
  36. <DataGridTextColumn
  37. Header="Пол"
  38. Binding="{Binding Gender}"/>
  39. <DataGridTextColumn
  40. Header="Прайс"
  41. Binding="{Binding Price}"/>
  42. <DataGridTextColumn
  43. Header="Место"
  44. Binding="{Binding Place}"/>
  45. </DataGrid.Columns>
  46. </DataGrid>
  47. <StackPanel
  48. Orientation="Vertical"
  49. Grid.RowSpan="3"
  50. VerticalAlignment="Bottom">
  51. <Button
  52. x:Name="ExitButton"
  53. Content="Выход"
  54. Click="ExitButton_Click"
  55. Height="50"/>
  56. </StackPanel>
  57. <WrapPanel
  58. Orientation="Horizontal"
  59. Grid.Column="1"
  60. MinHeight="50">
  61. <Label
  62. Content="Пол:"
  63. VerticalAlignment="Center"/>
  64. <ComboBox
  65. Name="GenderFilterComboBox"
  66. SelectionChanged="GenderFilterComboBox_SelectionChanged_1"
  67. VerticalAlignment="Center"
  68. MinWidth="100"
  69. SelectedIndex="0"
  70. ItemsSource="{Binding PeopleGenderList}">
  71. <ComboBox.ItemTemplate>
  72. <DataTemplate>
  73. <Label
  74. Content="{Binding title}"/>
  75. </DataTemplate>
  76. </ComboBox.ItemTemplate>
  77. </ComboBox>
  78. <Label
  79. Content="Возраст:"
  80. VerticalAlignment="Center"/>
  81. <ComboBox
  82. Name="AgeFilterComboBox"
  83. SelectionChanged="AgeFilterComboBox_SelectionChanged_2"
  84. VerticalAlignment="Center"
  85. MinWidth="100"
  86. SelectedIndex="0"
  87. ItemsSource="{Binding PeopleAgeList}">
  88. <ComboBox.ItemTemplate>
  89. <DataTemplate>
  90. <Label
  91. Content="{Binding title}"/>
  92. </DataTemplate>
  93. </ComboBox.ItemTemplate>
  94. </ComboBox>
  95. <Label
  96. Content="Место:"
  97. VerticalAlignment="Center"/>
  98. <ComboBox
  99. Name="PlaceFilterComboBox"
  100. SelectionChanged="PlaceFilterComboBox_SelectionChanged_3"
  101. VerticalAlignment="Center"
  102. MinWidth="100"
  103. SelectedIndex="0"
  104. ItemsSource="{Binding PeoplePlaceList}">
  105. <ComboBox.ItemTemplate>
  106. <DataTemplate>
  107. <Label
  108. Content="{Binding title}"/>
  109. </DataTemplate>
  110. </ComboBox.ItemTemplate>
  111. </ComboBox>
  112. <!-- минимальную высоту я тут поставил, чтобы верхнюю строку сетки было видно. В реальном приложении она не нужна -->
  113. </WrapPanel>
  114. </Grid>
  115. </Window>