MainWindow.xaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <Window x:Class="WpfApp2.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:WpfApp2"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  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. <Image
  20. Source="3.jpg"
  21. Grid.RowSpan="2" HorizontalAlignment="Right"/>
  22. <DataGrid
  23. Grid.Row="1"
  24. Grid.Column="1"
  25. CanUserAddRows="False"
  26. AutoGenerateColumns="False"
  27. ItemsSource="{Binding SparesList}">
  28. <DataGrid.Columns>
  29. <DataGridTextColumn
  30. Header="Название детали"
  31. Binding="{Binding name}"/>
  32. <DataGridTextColumn
  33. Header="Цена"
  34. Binding="{Binding price}"/>
  35. <DataGridTextColumn
  36. Header="Классификация детали"
  37. Binding="{Binding detail}"/>
  38. <DataGridTextColumn
  39. Header="Тип ТС"
  40. Binding="{Binding type}"/>
  41. </DataGrid.Columns>
  42. </DataGrid>
  43. <StackPanel
  44. Orientation="Vertical"
  45. Grid.RowSpan="3"
  46. VerticalAlignment="Bottom">
  47. <Button
  48. x:Name="ExitButton"
  49. Content="Выход"
  50. Click="ExitButton_Click"
  51. Height="50"/>
  52. </StackPanel>
  53. <WrapPanel
  54. Orientation="Horizontal"
  55. Grid.Column="1"
  56. MinHeight="50">
  57. <Label
  58. Content="Деталь:"
  59. VerticalAlignment="Center"/>
  60. <ComboBox
  61. Name="DetailFilterComboBox"
  62. SelectionChanged="DetailFilterComboBox_SelectionChanged_1"
  63. VerticalAlignment="Center"
  64. MinWidth="100"
  65. SelectedIndex="0"
  66. ItemsSource="{Binding SparesDetailList}">
  67. <ComboBox.ItemTemplate>
  68. <DataTemplate>
  69. <Label
  70. Content="{Binding title}"/>
  71. </DataTemplate>
  72. </ComboBox.ItemTemplate>
  73. </ComboBox>
  74. <Label
  75. Content="Цена:"
  76. VerticalAlignment="Center"/>
  77. <ComboBox
  78. Name="PriceFilterComboBox"
  79. SelectionChanged="PriceFilterComboBox_SelectionChanged_2"
  80. VerticalAlignment="Center"
  81. MinWidth="100"
  82. SelectedIndex="0"
  83. ItemsSource="{Binding SparesPriceList}">
  84. <ComboBox.ItemTemplate>
  85. <DataTemplate>
  86. <Label
  87. Content="{Binding title}"/>
  88. </DataTemplate>
  89. </ComboBox.ItemTemplate>
  90. </ComboBox>
  91. <Label
  92. Content="Тип ТС"
  93. VerticalAlignment="Center"/>
  94. <ComboBox
  95. Name="TypeFilterComboBox"
  96. SelectionChanged="TypeFilterComboBox_SelectionChanged_3"
  97. VerticalAlignment="Center"
  98. MinWidth="100"
  99. SelectedIndex="0"
  100. ItemsSource="{Binding SparesTypeList}">
  101. <ComboBox.ItemTemplate>
  102. <DataTemplate>
  103. <Label
  104. Content="{Binding title}"/>
  105. </DataTemplate>
  106. </ComboBox.ItemTemplate>
  107. </ComboBox>
  108. <RadioButton
  109. GroupName="Price"
  110. Tag="2"
  111. Content="Дороже"
  112. Checked="RadioButton_Checked"
  113. VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
  114. <RadioButton
  115. GroupName="Price"
  116. Tag="1"
  117. Content="Дешевле"
  118. IsChecked="True"
  119. Checked="RadioButton_Checked"
  120. VerticalAlignment="Center" Height="15" Width="69"/>
  121. <Label
  122. Content="Искать"
  123. VerticalAlignment="Center"/>
  124. <TextBox
  125. Width="200"
  126. VerticalAlignment="Center"
  127. x:Name="SearchFilterTextBox"
  128. KeyUp="SearchFilter_KeyUp"/>
  129. </WrapPanel>
  130. </Grid>
  131. </Window>