MainWindow.xaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <Window x:Class="WpfApp1.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:WpfApp1"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <Window.Resources>
  10. <Style
  11. x:Key="StackStyle"
  12. TargetType="ListBox">
  13. <Setter Property="ItemsPanel">
  14. <Setter.Value>
  15. <ItemsPanelTemplate>
  16. <StackPanel
  17. Orientation="Vertical"/>
  18. </ItemsPanelTemplate>
  19. </Setter.Value>
  20. </Setter>
  21. </Style>
  22. <Style
  23. x:Key="WrapStyle"
  24. TargetType="ListBox">
  25. <Setter Property="ItemsPanel">
  26. <Setter.Value>
  27. <ItemsPanelTemplate>
  28. <WrapPanel
  29. HorizontalAlignment="Center"
  30. ItemWidth="200"/>
  31. </ItemsPanelTemplate>
  32. </Setter.Value>
  33. </Setter>
  34. </Style>
  35. <BitmapImage
  36. x:Key='defaultImage'
  37. UriSource='C:\Users\uriq3\Desktop\oap_labs\img\1.jpeg' />
  38. </Window.Resources>
  39. <Window.Background>
  40. <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
  41. <GradientStop Color="LightSeaGreen" Offset="0"/>
  42. </LinearGradientBrush>
  43. </Window.Background>
  44. <Grid ShowGridLines="True">
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="auto"/>
  47. <RowDefinition />
  48. <RowDefinition Height="auto"/>
  49. </Grid.RowDefinitions>
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="200"/>
  52. <ColumnDefinition/>
  53. </Grid.ColumnDefinitions>
  54. <Image
  55. Source ="1.jpeg"
  56. Grid.RowSpan="2" HorizontalAlignment="Right"/>
  57. <ListBox
  58. Grid.Column="1"
  59. Grid.Row="1"
  60. Background="LightBlue"
  61. ItemsSource="{Binding WorkerList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  62. MouseDoubleClick="WorkerListBox_MouseDoubleClick"
  63. x:Name="WorkerListBox">
  64. <ListBox.ItemsPanel>
  65. <ItemsPanelTemplate>
  66. <WrapPanel
  67. HorizontalAlignment="Center" />
  68. </ItemsPanelTemplate>
  69. </ListBox.ItemsPanel>
  70. <ListBox.ItemTemplate>
  71. <DataTemplate>
  72. <Border
  73. BorderThickness="1"
  74. BorderBrush="Black"
  75. CornerRadius="5">
  76. <Grid
  77. Width="200"
  78. Margin="10"
  79. HorizontalAlignment="Stretch">
  80. <Grid.ColumnDefinitions>
  81. <ColumnDefinition Width="64"/>
  82. <ColumnDefinition Width="*"/>
  83. <ColumnDefinition Width="auto"/>
  84. </Grid.ColumnDefinitions>
  85. <Image
  86. Width="64"
  87. Height="64"
  88. Source="{Binding ImageBitmap}" />
  89. <StackPanel
  90. Grid.Column="1"
  91. Margin="5"
  92. Orientation="Vertical">
  93. <TextBlock
  94. Text="{Binding name}"/>
  95. <TextBlock
  96. Text="{Binding Pos}"/>
  97. <TextBlock
  98. Text="{Binding Sex}"/>
  99. </StackPanel>
  100. <TextBlock
  101. Grid.Column="2"
  102. Text="{Binding Age}"/>
  103. </Grid>
  104. </Border>
  105. </DataTemplate>
  106. </ListBox.ItemTemplate>
  107. </ListBox>
  108. <StackPanel
  109. Orientation="Vertical"
  110. Grid.RowSpan="3"
  111. VerticalAlignment="Bottom">
  112. <Button
  113. x:Name="ExitButton"
  114. Content="Выход"
  115. Click="ExitButton_Click"
  116. Height="50"/>
  117. </StackPanel>
  118. <StackPanel
  119. x:Name="buttonsStack"
  120. Background="White" >
  121. <Button
  122. x:Name="button1"
  123. Content="Кнопка 1" />
  124. <Button
  125. x:Name="button2"
  126. Content="Кнопка 2" Click="button2_Click" />
  127. </StackPanel>
  128. <WrapPanel
  129. Orientation="Horizontal"
  130. Grid.Column="1"
  131. MinHeight="50">
  132. <Label
  133. Content="Должность:"
  134. VerticalAlignment="Center"/>
  135. <ComboBox
  136. Name="PosFilterComboBox"
  137. SelectionChanged="PosFilterComboBox_SelectionChanged_1"
  138. VerticalAlignment="Center"
  139. MinWidth="100"
  140. SelectedIndex="0"
  141. ItemsSource="{Binding WorkerPosList}">
  142. <ComboBox.ItemTemplate>
  143. <DataTemplate>
  144. <Label
  145. Content="{Binding title}"/>
  146. </DataTemplate>
  147. </ComboBox.ItemTemplate>
  148. </ComboBox>
  149. <Label
  150. Content="Возраст:"
  151. VerticalAlignment="Center"/>
  152. <ComboBox
  153. Name="AgeFilterComboBox"
  154. SelectionChanged="AgeFilterComboBox_SelectionChanged_2"
  155. VerticalAlignment="Center"
  156. MinWidth="100"
  157. SelectedIndex="0"
  158. ItemsSource="{Binding WorkerAgeList}">
  159. <ComboBox.ItemTemplate>
  160. <DataTemplate>
  161. <Label
  162. Content="{Binding title}"/>
  163. </DataTemplate>
  164. </ComboBox.ItemTemplate>
  165. </ComboBox>
  166. <Label
  167. Content="Пол"
  168. VerticalAlignment="Center"/>
  169. <ComboBox
  170. Name="SexFilterComboBox"
  171. SelectionChanged="SexFilterComboBox_SelectionChanged_3"
  172. VerticalAlignment="Center"
  173. MinWidth="100"
  174. SelectedIndex="0"
  175. ItemsSource="{Binding WorkerSexList}">
  176. <ComboBox.ItemTemplate>
  177. <DataTemplate>
  178. <Label
  179. Content="{Binding title}"/>
  180. </DataTemplate>
  181. </ComboBox.ItemTemplate>
  182. </ComboBox>
  183. <RadioButton
  184. GroupName="Price"
  185. Tag="2"
  186. Content="Старше"
  187. Checked="RadioButton_Checked"
  188. VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
  189. <RadioButton
  190. GroupName="Price"
  191. Tag="1"
  192. Content="Младше"
  193. IsChecked="True"
  194. Checked="RadioButton_Checked"
  195. VerticalAlignment="Center" Height="15" Width="69"/>
  196. <Label
  197. Content="Искать"
  198. VerticalAlignment="Center"/>
  199. <TextBox
  200. Width="200"
  201. VerticalAlignment="Center"
  202. x:Name="SearchFilterTextBox"
  203. KeyUp="SearchFilter_KeyUp"/>
  204. </WrapPanel>
  205. </Grid>
  206. </Window>