MainWindow.xaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. <DataGridTextColumn
  42. Header="Дата завоза"
  43. Binding="{Binding date,StringFormat='dd.MM.yyyy'}"/>
  44. <DataGridTextColumn
  45. Header="Наличие"
  46. Binding="{Binding available}"/>
  47. </DataGrid.Columns>
  48. </DataGrid>
  49. <StackPanel
  50. Orientation="Vertical"
  51. Grid.RowSpan="3"
  52. VerticalAlignment="Bottom">
  53. <Button
  54. x:Name="ExitButton"
  55. Content="Выход"
  56. Click="ExitButton_Click"
  57. Height="50"/>
  58. </StackPanel>
  59. <WrapPanel
  60. Orientation="Horizontal"
  61. Grid.Column="1"
  62. MinHeight="50">
  63. <Label
  64. Content="Деталь:"
  65. VerticalAlignment="Center"/>
  66. <ComboBox
  67. Name="DetailFilterComboBox"
  68. SelectionChanged="DetailFilterComboBox_SelectionChanged_1"
  69. VerticalAlignment="Center"
  70. MinWidth="100"
  71. SelectedIndex="0"
  72. ItemsSource="{Binding SparesDetailList}">
  73. <ComboBox.ItemTemplate>
  74. <DataTemplate>
  75. <Label
  76. Content="{Binding title}"/>
  77. </DataTemplate>
  78. </ComboBox.ItemTemplate>
  79. </ComboBox>
  80. <Label
  81. Content="Цена:"
  82. VerticalAlignment="Center"/>
  83. <ComboBox
  84. Name="PriceFilterComboBox"
  85. SelectionChanged="PriceFilterComboBox_SelectionChanged_2"
  86. VerticalAlignment="Center"
  87. MinWidth="100"
  88. SelectedIndex="0"
  89. ItemsSource="{Binding SparesPriceList}">
  90. <ComboBox.ItemTemplate>
  91. <DataTemplate>
  92. <Label
  93. Content="{Binding title}"/>
  94. </DataTemplate>
  95. </ComboBox.ItemTemplate>
  96. </ComboBox>
  97. <Label
  98. Content="Тип ТС"
  99. VerticalAlignment="Center"/>
  100. <ComboBox
  101. Name="TypeFilterComboBox"
  102. SelectionChanged="TypeFilterComboBox_SelectionChanged_3"
  103. VerticalAlignment="Center"
  104. MinWidth="100"
  105. SelectedIndex="0"
  106. ItemsSource="{Binding SparesTypeList}">
  107. <ComboBox.ItemTemplate>
  108. <DataTemplate>
  109. <Label
  110. Content="{Binding title}"/>
  111. </DataTemplate>
  112. </ComboBox.ItemTemplate>
  113. </ComboBox>
  114. <RadioButton
  115. GroupName="Price"
  116. Tag="2"
  117. Content="Дороже"
  118. Checked="RadioButton_Checked"
  119. VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
  120. <RadioButton
  121. GroupName="Price"
  122. Tag="1"
  123. Content="Дешевле"
  124. IsChecked="True"
  125. Checked="RadioButton_Checked"
  126. VerticalAlignment="Center" Height="15" Width="69"/>
  127. <Label
  128. Content="Искать"
  129. VerticalAlignment="Center"/>
  130. <TextBox
  131. Width="200"
  132. VerticalAlignment="Center"
  133. x:Name="SearchFilterTextBox"
  134. KeyUp="SearchFilter_KeyUp"/>
  135. </WrapPanel>
  136. </Grid>
  137. </Window>