MainWindow.xaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. 
  2. <Window x:Class="WpfApp2.MainWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:local="clr-namespace:WpfApp2"
  8. mc:Ignorable="d"
  9. Title="MainWindow" Height="450" Width="800">
  10. <Window.Resources>
  11. <Style
  12. TargetType="Button">
  13. <Setter
  14. Property="FontFamily"
  15. Value="Verdana" />
  16. <Setter
  17. Property="Background"
  18. Value="LightGoldenrodYellow" />
  19. <Setter
  20. Property="Foreground"
  21. Value="Black" />
  22. <Setter
  23. Property="Margin"
  24. Value="10" />
  25. <EventSetter
  26. Event="Button.Click"
  27. Handler="Button_Click" />
  28. </Style>
  29. </Window.Resources>
  30. <Window.Background>
  31. <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
  32. <GradientStop Color="DarkOliveGreen" Offset="0"/>
  33. <GradientStop Color="RosyBrown" Offset="0.5"/>
  34. <GradientStop Color="Brown" Offset="1"/>
  35. </LinearGradientBrush>
  36. </Window.Background>
  37. <Grid ShowGridLines="True">
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="auto"/>
  40. <RowDefinition />
  41. <RowDefinition Height="auto"/>
  42. </Grid.RowDefinitions>
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition Width="200"/>
  45. <ColumnDefinition/>
  46. </Grid.ColumnDefinitions>
  47. <Image
  48. Source="3.jpg"
  49. Grid.RowSpan="2" HorizontalAlignment="Left"/>
  50. <ListBox
  51. Grid.Column="1"
  52. Grid.Row="1"
  53. Background="White"
  54. ItemsSource="{Binding SparesList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  55. <ListBox.ItemsPanel>
  56. <ItemsPanelTemplate>
  57. <WrapPanel
  58. HorizontalAlignment="Center" />
  59. </ItemsPanelTemplate>
  60. </ListBox.ItemsPanel>
  61. <ListBox.ItemTemplate>
  62. <DataTemplate>
  63. <Border
  64. BorderThickness="1"
  65. BorderBrush="Black"
  66. CornerRadius="5">
  67. <Grid
  68. Width="200"
  69. Margin="10"
  70. HorizontalAlignment="Stretch">
  71. <Grid.ColumnDefinitions>
  72. <ColumnDefinition Width="64"/>
  73. <ColumnDefinition Width="*"/>
  74. <ColumnDefinition Width="auto"/>
  75. </Grid.ColumnDefinitions>
  76. <Image
  77. Width="64"
  78. Height="64"
  79. Source="{Binding ImageBitmap}" />
  80. <StackPanel
  81. Grid.Column="1"
  82. Margin="5"
  83. Orientation="Vertical">
  84. <TextBlock
  85. Text="{Binding name}"/>
  86. <TextBlock
  87. Text="{Binding deatail}"/>
  88. </StackPanel>
  89. <TextBlock
  90. Grid.Column="2"
  91. Text="{Binding price}"/>
  92. </Grid>
  93. </Border>
  94. </DataTemplate>
  95. </ListBox.ItemTemplate>
  96. </ListBox>
  97. <StackPanel
  98. Orientation="Vertical"
  99. Grid.RowSpan="3"
  100. VerticalAlignment="Bottom">
  101. <Button
  102. x:Name="ExitButton"
  103. Content="Выход"
  104. Click="ExitButton_Click"
  105. Height="50"
  106. Background="HotPink"/>
  107. </StackPanel>
  108. <StackPanel
  109. x:Name="buttonsStack"
  110. Background="Yellow" >
  111. <Button
  112. x:Name="button1"
  113. Content="Кнопка 1" />
  114. <Button
  115. x:Name="button2"
  116. Content="Кнопка 2" />
  117. </StackPanel>
  118. <WrapPanel
  119. Orientation="Horizontal"
  120. Grid.Column="1"
  121. MinHeight="50">
  122. <Label
  123. Content="Деталь:"
  124. VerticalAlignment="Center"/>
  125. <ComboBox
  126. Name="DetailFilterComboBox"
  127. SelectionChanged="DetailFilterComboBox_SelectionChanged_1"
  128. VerticalAlignment="Center"
  129. MinWidth="100"
  130. SelectedIndex="0"
  131. ItemsSource="{Binding SparesDetailList}">
  132. <ComboBox.ItemTemplate>
  133. <DataTemplate>
  134. <Label
  135. Content="{Binding title}"/>
  136. </DataTemplate>
  137. </ComboBox.ItemTemplate>
  138. </ComboBox>
  139. <Label
  140. Content="Цена:"
  141. VerticalAlignment="Center"/>
  142. <ComboBox
  143. Name="PriceFilterComboBox"
  144. SelectionChanged="PriceFilterComboBox_SelectionChanged_2"
  145. VerticalAlignment="Center"
  146. MinWidth="100"
  147. SelectedIndex="0"
  148. ItemsSource="{Binding SparesPriceList}">
  149. <ComboBox.ItemTemplate>
  150. <DataTemplate>
  151. <Label
  152. Content="{Binding title}"/>
  153. </DataTemplate>
  154. </ComboBox.ItemTemplate>
  155. </ComboBox>
  156. <Label
  157. Content="Тип ТС"
  158. VerticalAlignment="Center"/>
  159. <ComboBox
  160. Name="TypeFilterComboBox"
  161. SelectionChanged="TypeFilterComboBox_SelectionChanged_3"
  162. VerticalAlignment="Center"
  163. MinWidth="100"
  164. SelectedIndex="0"
  165. ItemsSource="{Binding SparesTypeList}">
  166. <ComboBox.ItemTemplate>
  167. <DataTemplate>
  168. <Label
  169. Content="{Binding title}"/>
  170. </DataTemplate>
  171. </ComboBox.ItemTemplate>
  172. </ComboBox>
  173. <RadioButton
  174. GroupName="Price"
  175. Tag="2"
  176. Content="Дороже"
  177. Checked="RadioButton_Checked"
  178. VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
  179. <RadioButton
  180. GroupName="Price"
  181. Tag="1"
  182. Content="Дешевле"
  183. IsChecked="True"
  184. Checked="RadioButton_Checked"
  185. VerticalAlignment="Center" Height="15" Width="69"/>
  186. <Label
  187. Content="Искать"
  188. VerticalAlignment="Center"/>
  189. <TextBox
  190. Width="200"
  191. VerticalAlignment="Center"
  192. x:Name="SearchFilterTextBox"
  193. KeyUp="SearchFilter_KeyUp"/>
  194. </WrapPanel>
  195. </Grid>
  196. </Window>