MainWindow.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <Window x:Class="wpf_template.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:wpf_template"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="950">
  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="assets/nagievlogo2.jpg"
  21. Grid.Row="1"
  22. Grid.RowSpan="2"/>
  23. <StackPanel
  24. Orientation="Vertical"
  25. Grid.RowSpan="3"
  26. Grid.Row="2"
  27. VerticalAlignment="Bottom">
  28. <Button
  29. x:Name="ExitButton"
  30. Content="Выход"
  31. Click="ExitButton_Click"
  32. Height="50"/>
  33. </StackPanel>
  34. <DataGrid
  35. Grid.Row="1"
  36. Grid.Column="1"
  37. CanUserAddRows="False"
  38. AutoGenerateColumns="False"
  39. ItemsSource="{Binding ProductList}">
  40. <DataGrid.Columns>
  41. <DataGridTextColumn
  42. Header="Категория"
  43. Binding="{Binding Category}"/>
  44. <DataGridTextColumn
  45. Header="Компания"
  46. Binding="{Binding Company}"/>
  47. <DataGridTextColumn
  48. Header="Название"
  49. Binding="{Binding Title}"/>
  50. <DataGridTextColumn
  51. Header="Цена"
  52. Binding="{Binding Price}"/>
  53. <DataGridTextColumn
  54. Header="Наличие"
  55. Binding="{Binding ExistenceString}"/>
  56. <DataGridTextColumn
  57. Header="Дата поступления"
  58. Binding="{Binding ArrivalDate,StringFormat='dd.MM.yyyy'}"/>
  59. <DataGridTextColumn
  60. Header="Оценка"
  61. Binding="{Binding Rating}"/>
  62. </DataGrid.Columns>
  63. </DataGrid>
  64. <WrapPanel
  65. Orientation="Horizontal"
  66. Grid.Column="1"
  67. MinHeight="50"
  68. Margin="0 5 0 0">
  69. <Label
  70. Content="Категория:"
  71. VerticalAlignment="Center"/>
  72. <ComboBox
  73. Name="CategoryFilterComboBox"
  74. SelectionChanged="CategoryFilterComboBox_SelectionChanged"
  75. VerticalAlignment="Center"
  76. MinWidth="100"
  77. SelectedIndex="0"
  78. ItemsSource="{Binding CategoryList}">
  79. <ComboBox.ItemTemplate>
  80. <DataTemplate>
  81. <Label
  82. Content="{Binding title}"/>
  83. </DataTemplate>
  84. </ComboBox.ItemTemplate>
  85. </ComboBox>
  86. <Label
  87. Content="Цена"/>
  88. <ComboBox
  89. Name ="PriceFilterComboBox"
  90. SelectionChanged="PriceFilterComboBox_SelectionChanged"
  91. VerticalAlignment="Center"
  92. MinWidth="100"
  93. SelectedIndex="0"
  94. ItemsSource="{Binding ProductPrices}">
  95. <ComboBox.ItemTemplate>
  96. <DataTemplate>
  97. <Label
  98. Content="{Binding title}"/>
  99. </DataTemplate>
  100. </ComboBox.ItemTemplate>
  101. </ComboBox>
  102. <Label
  103. Content="Компания"/>
  104. <ComboBox
  105. Name ="CompanyFilterComboBox"
  106. SelectionChanged="CompanyFilterComboBox_SelectionChanged"
  107. VerticalAlignment="Center"
  108. MinWidth="100"
  109. SelectedIndex="0"
  110. ItemsSource="{Binding ProductCompanies}">
  111. <ComboBox.ItemTemplate>
  112. <DataTemplate>
  113. <Label
  114. Content="{Binding title}"/>
  115. </DataTemplate>
  116. </ComboBox.ItemTemplate>
  117. </ComboBox>
  118. <Label
  119. Content="Поиск"
  120. VerticalAlignment="Center"/>
  121. <TextBox
  122. Width="180"
  123. VerticalAlignment="Center"
  124. x:Name="SearchFilterTextBox"
  125. KeyUp="SearchFilterTextBox_KeyUp"/>
  126. <Label
  127. Content="Цена:"
  128. VerticalAlignment="Center"/>
  129. <RadioButton
  130. GroupName="Price"
  131. Tag="1"
  132. Content="по возрастанию"
  133. IsChecked="True"
  134. Checked="RadioButton_Checked"
  135. VerticalAlignment="Center"/>
  136. <RadioButton
  137. GroupName="Price"
  138. Tag="2"
  139. Content="по убыванию"
  140. Checked="RadioButton_Checked"
  141. VerticalAlignment="Center"/>
  142. </WrapPanel>
  143. </Grid>
  144. </Window>