MainWindow.xaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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="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="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. </DataGrid.Columns>
  54. </DataGrid>
  55. <WrapPanel
  56. Orientation="Horizontal"
  57. Grid.Column="1"
  58. MinHeight="50
  59. ">
  60. <Label
  61. Content="Категория:"
  62. VerticalAlignment="Center"/>
  63. <ComboBox
  64. Name="CategoryFilterComboBox"
  65. SelectionChanged="CategoryFilterComboBox_SelectionChanged"
  66. VerticalAlignment="Center"
  67. MinWidth="100"
  68. SelectedIndex="0"
  69. ItemsSource="{Binding CategoryList}">
  70. <ComboBox.ItemTemplate>
  71. <DataTemplate>
  72. <Label
  73. Content="{Binding title}"/>
  74. </DataTemplate>
  75. </ComboBox.ItemTemplate>
  76. </ComboBox>
  77. <Label
  78. Content="Цена"/>
  79. <ComboBox
  80. Name ="PriceFilterComboBox"
  81. SelectionChanged="PriceFilterComboBox_SelectionChanged"
  82. VerticalAlignment="Center"
  83. MinWidth="100"
  84. SelectedIndex="0"
  85. ItemsSource="{Binding ProductPrices}">
  86. <ComboBox.ItemTemplate>
  87. <DataTemplate>
  88. <Label
  89. Content="{Binding title}"/>
  90. </DataTemplate>
  91. </ComboBox.ItemTemplate>
  92. </ComboBox>
  93. <Label
  94. Content="Компания"/>
  95. <ComboBox
  96. Name ="CompanyFilterComboBox"
  97. SelectionChanged="CompanyFilterComboBox_SelectionChanged"
  98. VerticalAlignment="Center"
  99. MinWidth="100"
  100. SelectedIndex="0"
  101. ItemsSource="{Binding ProductCompanies}">
  102. <ComboBox.ItemTemplate>
  103. <DataTemplate>
  104. <Label
  105. Content="{Binding title}"/>
  106. </DataTemplate>
  107. </ComboBox.ItemTemplate>
  108. </ComboBox>
  109. </WrapPanel>
  110. </Grid>
  111. </Window>