MainWindow.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <BitmapImage
  12. x:Key='defaultImage'
  13. UriSource='C:\Users\User\Desktop\WpfApp1\WpfApp1\bin\Debug\net8.0-windows\img\pornGirl.jpg' />
  14. </Window.Resources>
  15. <Grid ShowGridLines="True">
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="auto"/>
  18. <RowDefinition />
  19. <RowDefinition Height="auto"/>
  20. </Grid.RowDefinitions>
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition Width="200"/>
  23. <ColumnDefinition/>
  24. </Grid.ColumnDefinitions>
  25. <Image
  26. Source="3.jpg"
  27. Grid.RowSpan="2" HorizontalAlignment="Left"/>
  28. <ListBox
  29. Grid.Column="1"
  30. Grid.Row="1"
  31. Background="White"
  32. ItemsSource="{Binding SparesList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  33. <ListBox.ItemsPanel>
  34. <ItemsPanelTemplate>
  35. <WrapPanel
  36. HorizontalAlignment="Center" />
  37. </ItemsPanelTemplate>
  38. </ListBox.ItemsPanel>
  39. <ListBox.ItemTemplate>
  40. <DataTemplate>
  41. <Border
  42. BorderThickness="1"
  43. BorderBrush="Black"
  44. CornerRadius="5">
  45. <Grid
  46. Width="200"
  47. Margin="10"
  48. HorizontalAlignment="Stretch">
  49. <Grid.ColumnDefinitions>
  50. <ColumnDefinition Width="64"/>
  51. <ColumnDefinition Width="*"/>
  52. <ColumnDefinition Width="auto"/>
  53. </Grid.ColumnDefinitions>
  54. <Image
  55. Width="64"
  56. Height="64"
  57. Source="{Binding ImageBitmap}" />
  58. <StackPanel
  59. Grid.Column="1"
  60. Margin="5"
  61. Orientation="Vertical">
  62. <TextBlock
  63. Text="{Binding name}"/>
  64. <TextBlock
  65. Text="{Binding deatail}"/>
  66. </StackPanel>
  67. <TextBlock
  68. Grid.Column="2"
  69. Text="{Binding price}"/>
  70. </Grid>
  71. </Border>
  72. </DataTemplate>
  73. </ListBox.ItemTemplate>
  74. </ListBox>
  75. <StackPanel
  76. Orientation="Vertical"
  77. Grid.RowSpan="3"
  78. VerticalAlignment="Bottom">
  79. <Button
  80. x:Name="ExitButton"
  81. Content="Выход"
  82. Click="ExitButton_Click"
  83. Height="50"/>
  84. </StackPanel>
  85. <WrapPanel
  86. Orientation="Horizontal"
  87. Grid.Column="1"
  88. MinHeight="50">
  89. <Label
  90. Content="Деталь:"
  91. VerticalAlignment="Center"/>
  92. <ComboBox
  93. Name="DetailFilterComboBox"
  94. SelectionChanged="DetailFilterComboBox_SelectionChanged_1"
  95. VerticalAlignment="Center"
  96. MinWidth="100"
  97. SelectedIndex="0"
  98. ItemsSource="{Binding SparesDetailList}">
  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="PriceFilterComboBox"
  111. SelectionChanged="PriceFilterComboBox_SelectionChanged_2"
  112. VerticalAlignment="Center"
  113. MinWidth="100"
  114. SelectedIndex="0"
  115. ItemsSource="{Binding SparesPriceList}">
  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. <ComboBox
  127. Name="TypeFilterComboBox"
  128. SelectionChanged="TypeFilterComboBox_SelectionChanged_3"
  129. VerticalAlignment="Center"
  130. MinWidth="100"
  131. SelectedIndex="0"
  132. ItemsSource="{Binding SparesTypeList}">
  133. <ComboBox.ItemTemplate>
  134. <DataTemplate>
  135. <Label
  136. Content="{Binding title}"/>
  137. </DataTemplate>
  138. </ComboBox.ItemTemplate>
  139. </ComboBox>
  140. <RadioButton
  141. GroupName="Price"
  142. Tag="2"
  143. Content="Дороже"
  144. Checked="RadioButton_Checked"
  145. VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
  146. <RadioButton
  147. GroupName="Price"
  148. Tag="1"
  149. Content="Дешевле"
  150. IsChecked="True"
  151. Checked="RadioButton_Checked"
  152. VerticalAlignment="Center" Height="15" Width="69"/>
  153. <Label
  154. Content="Искать"
  155. VerticalAlignment="Center"/>
  156. <TextBox
  157. Width="200"
  158. VerticalAlignment="Center"
  159. x:Name="SearchFilterTextBox"
  160. KeyUp="SearchFilter_KeyUp"/>
  161. </WrapPanel>
  162. </Grid>
  163. </Window>