MainWindow.xaml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="LightBlue"
  54. ItemsSource="{Binding SparesList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  55. MouseDoubleClick="SparesListBox_MouseDoubleClick"
  56. x:Name="SparesListBox">
  57. <ListBox.ItemsPanel>
  58. <ItemsPanelTemplate>
  59. <WrapPanel
  60. HorizontalAlignment="Center" />
  61. </ItemsPanelTemplate>
  62. </ListBox.ItemsPanel>
  63. <ListBox.ItemTemplate>
  64. <DataTemplate>
  65. <Border
  66. BorderThickness="1"
  67. BorderBrush="Black"
  68. CornerRadius="5">
  69. <Grid
  70. Width="200"
  71. Margin="10"
  72. HorizontalAlignment="Stretch">
  73. <Grid.ColumnDefinitions>
  74. <ColumnDefinition Width="64"/>
  75. <ColumnDefinition Width="*"/>
  76. <ColumnDefinition Width="auto"/>
  77. </Grid.ColumnDefinitions>
  78. <Image
  79. Width="64"
  80. Height="64"
  81. Source="{Binding ImageBitmap}" />
  82. <StackPanel
  83. Grid.Column="1"
  84. Margin="5"
  85. Orientation="Vertical">
  86. <TextBlock
  87. Text="{Binding name}"/>
  88. <TextBlock
  89. Text="{Binding deatail}"/>
  90. </StackPanel>
  91. <TextBlock
  92. Grid.Column="2"
  93. Text="{Binding price}"/>
  94. </Grid>
  95. </Border>
  96. </DataTemplate>
  97. </ListBox.ItemTemplate>
  98. </ListBox>
  99. <StackPanel
  100. Orientation="Vertical"
  101. Grid.RowSpan="3"
  102. VerticalAlignment="Bottom">
  103. <Button
  104. x:Name="ExitButton"
  105. Content="Выход"
  106. Click="ExitButton_Click"
  107. Height="50"
  108. Background="HotPink"/>
  109. </StackPanel>
  110. <StackPanel
  111. x:Name="buttonsStack"
  112. Background="Yellow" >
  113. <Button
  114. x:Name="button1"
  115. Content="Кнопка 1" />
  116. <Button
  117. x:Name="button2"
  118. Content="Кнопка 2" />
  119. </StackPanel>
  120. <WrapPanel
  121. Orientation="Horizontal"
  122. Grid.Column="1"
  123. MinHeight="50">
  124. <Label
  125. Content="Деталь:"
  126. VerticalAlignment="Center"/>
  127. <ComboBox
  128. Name="DetailFilterComboBox"
  129. SelectionChanged="DetailFilterComboBox_SelectionChanged_1"
  130. VerticalAlignment="Center"
  131. MinWidth="100"
  132. SelectedIndex="0"
  133. ItemsSource="{Binding SparesDetailList}">
  134. <ComboBox.ItemTemplate>
  135. <DataTemplate>
  136. <Label
  137. Content="{Binding title}"/>
  138. </DataTemplate>
  139. </ComboBox.ItemTemplate>
  140. </ComboBox>
  141. <Label
  142. Content="Цена:"
  143. VerticalAlignment="Center"/>
  144. <ComboBox
  145. Name="PriceFilterComboBox"
  146. SelectionChanged="PriceFilterComboBox_SelectionChanged_2"
  147. VerticalAlignment="Center"
  148. MinWidth="100"
  149. SelectedIndex="0"
  150. ItemsSource="{Binding SparesPriceList}">
  151. <ComboBox.ItemTemplate>
  152. <DataTemplate>
  153. <Label
  154. Content="{Binding title}"/>
  155. </DataTemplate>
  156. </ComboBox.ItemTemplate>
  157. </ComboBox>
  158. <Label
  159. Content="Тип ТС"
  160. VerticalAlignment="Center"/>
  161. <ComboBox
  162. Name="TypeFilterComboBox"
  163. SelectionChanged="TypeFilterComboBox_SelectionChanged_3"
  164. VerticalAlignment="Center"
  165. MinWidth="100"
  166. SelectedIndex="0"
  167. ItemsSource="{Binding SparesTypeList}">
  168. <ComboBox.ItemTemplate>
  169. <DataTemplate>
  170. <Label
  171. Content="{Binding title}"/>
  172. </DataTemplate>
  173. </ComboBox.ItemTemplate>
  174. </ComboBox>
  175. <RadioButton
  176. GroupName="Price"
  177. Tag="2"
  178. Content="Дороже"
  179. Checked="RadioButton_Checked"
  180. VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
  181. <RadioButton
  182. GroupName="Price"
  183. Tag="1"
  184. Content="Дешевле"
  185. IsChecked="True"
  186. Checked="RadioButton_Checked"
  187. VerticalAlignment="Center" Height="15" Width="69"/>
  188. <Label
  189. Content="Искать"
  190. VerticalAlignment="Center"/>
  191. <TextBox
  192. Width="200"
  193. VerticalAlignment="Center"
  194. x:Name="SearchFilterTextBox"
  195. KeyUp="SearchFilter_KeyUp"/>
  196. </WrapPanel>
  197. </Grid>
  198. </Window>