MainWindow.xaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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="880">
  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. <TextBox
  65. Width="200"
  66. VerticalAlignment="Center"
  67. x:Name="SearchFilterTextBox"
  68. KeyUp="SearchFilter_KeyUp"/>
  69. <ComboBox
  70. Name="GenderFilterComboBox"
  71. SelectionChanged="GenderFilterComboBox_SelectionChanged_1"
  72. VerticalAlignment="Center"
  73. MinWidth="100"
  74. SelectedIndex="0"
  75. ItemsSource="{Binding PeopleGenderList}">
  76. <ComboBox.ItemTemplate>
  77. <DataTemplate>
  78. <Label
  79. Content="{Binding title}"/>
  80. </DataTemplate>
  81. </ComboBox.ItemTemplate>
  82. </ComboBox>
  83. <Label
  84. Content="Возраст:"
  85. VerticalAlignment="Center"/>
  86. <ComboBox
  87. Name="AgeFilterComboBox"
  88. SelectionChanged="AgeFilterComboBox_SelectionChanged_2"
  89. VerticalAlignment="Center"
  90. MinWidth="100"
  91. SelectedIndex="0"
  92. ItemsSource="{Binding PeopleAgeList}">
  93. <ComboBox.ItemTemplate>
  94. <DataTemplate>
  95. <Label
  96. Content="{Binding title}"/>
  97. </DataTemplate>
  98. </ComboBox.ItemTemplate>
  99. </ComboBox>
  100. <Label
  101. Content="Место:"
  102. VerticalAlignment="Center"/>
  103. <ComboBox
  104. Name="PlaceFilterComboBox"
  105. SelectionChanged="PlaceFilterComboBox_SelectionChanged_3"
  106. VerticalAlignment="Center"
  107. MinWidth="100"
  108. SelectedIndex="0"
  109. ItemsSource="{Binding PeoplePlaceList}">
  110. <ComboBox.ItemTemplate>
  111. <DataTemplate>
  112. <Label
  113. Content="{Binding title}"/>
  114. </DataTemplate>
  115. </ComboBox.ItemTemplate>
  116. </ComboBox>
  117. <Label
  118. Content="Цена:"
  119. VerticalAlignment="Center"/>
  120. <RadioButton
  121. GroupName="Price"
  122. Tag="1"
  123. Content="Сначала недорогие"
  124. IsChecked="True"
  125. Checked="RadioButton_Checked"
  126. VerticalAlignment="Center"/>
  127. <RadioButton
  128. GroupName="Price"
  129. Tag="2"
  130. Content="Сначала дорогие"
  131. Checked="RadioButton_Checked"
  132. VerticalAlignment="Center"/>
  133. <!-- минимальную высоту я тут поставил, чтобы верхнюю строку сетки было видно. В реальном приложении она не нужна -->
  134. </WrapPanel>
  135. </Grid>
  136. </Window>