MainWindow.xaml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <Window x:Class="wpf_data.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_data"
  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. <DataGridTextColumn
  46. Header="Фаворит"
  47. Binding="{Binding IsFavorite}"/>
  48. <DataGridTextColumn
  49. Header="Дата"
  50. Binding="{Binding dateOfConnections,StringFormat='dd.MM.yyyy'}"/>
  51. </DataGrid.Columns>
  52. </DataGrid>
  53. <StackPanel
  54. Orientation="Vertical"
  55. Grid.RowSpan="3"
  56. VerticalAlignment="Bottom">
  57. <Button
  58. x:Name="ExitButton"
  59. Content="Выход"
  60. Click="ExitButton_Click"
  61. Height="50"/>
  62. </StackPanel>
  63. <WrapPanel
  64. Orientation="Horizontal"
  65. Grid.Column="1"
  66. MinHeight="50">
  67. <Label
  68. Content="искать"
  69. VerticalAlignment="Center"/>
  70. <TextBox
  71. Width="200"
  72. VerticalAlignment="Center"
  73. x:Name="SearchFilterTextBox"
  74. KeyUp="SearchFilter_KeyUp"/>
  75. <ComboBox
  76. Name="GenderFilterComboBox"
  77. SelectionChanged="GenderFilterComboBox_SelectionChanged_1"
  78. VerticalAlignment="Center"
  79. MinWidth="100"
  80. SelectedIndex="0"
  81. ItemsSource="{Binding PeopleGenderList}">
  82. <ComboBox.ItemTemplate>
  83. <DataTemplate>
  84. <Label
  85. Content="{Binding title}"/>
  86. </DataTemplate>
  87. </ComboBox.ItemTemplate>
  88. </ComboBox>
  89. <Label
  90. Content="Возраст:"
  91. VerticalAlignment="Center"/>
  92. <ComboBox
  93. Name="AgeFilterComboBox"
  94. SelectionChanged="AgeFilterComboBox_SelectionChanged_2"
  95. VerticalAlignment="Center"
  96. MinWidth="100"
  97. SelectedIndex="0"
  98. ItemsSource="{Binding PeopleAgeList}">
  99. <ComboBox.ItemTemplate>
  100. <DataTemplate>
  101. <Label
  102. Content="{Binding title}"/>
  103. </DataTemplate>
  104. </ComboBox.ItemTemplate>
  105. </ComboBox>
  106. <Label
  107. Content="Место:"
  108. VerticalAlignment="Center"/>
  109. <ComboBox
  110. Name="PlaceFilterComboBox"
  111. SelectionChanged="PlaceFilterComboBox_SelectionChanged_3"
  112. VerticalAlignment="Center"
  113. MinWidth="100"
  114. SelectedIndex="0"
  115. ItemsSource="{Binding PeoplePlaceList}">
  116. <ComboBox.ItemTemplate>
  117. <DataTemplate>
  118. <Label
  119. Content="{Binding title}"/>
  120. </DataTemplate>
  121. </ComboBox.ItemTemplate>
  122. </ComboBox>
  123. <Label
  124. Content="Цена:"
  125. VerticalAlignment="Center"/>
  126. <RadioButton
  127. GroupName="Price"
  128. Tag="1"
  129. Content="Сначала недорогие"
  130. IsChecked="True"
  131. Checked="RadioButton_Checked"
  132. VerticalAlignment="Center"/>
  133. <RadioButton
  134. GroupName="Price"
  135. Tag="2"
  136. Content="Сначала дорогие"
  137. Checked="RadioButton_Checked"
  138. VerticalAlignment="Center"/>
  139. <!-- минимальную высоту я тут поставил, чтобы верхнюю строку сетки было видно. В реальном приложении она не нужна -->
  140. </WrapPanel>
  141. </Grid>
  142. </Window>