MainWindow.xaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <Window x:Class="mysql.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:mysql"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="1000">
  9. <Window.Resources>
  10. <BitmapImage
  11. x:Key='defaultImage'
  12. UriSource='./Images/picture.png' />
  13. </Window.Resources>
  14. <Grid>
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="150"/>
  17. <ColumnDefinition Width="*"/>
  18. </Grid.ColumnDefinitions>
  19. <Grid Grid.Column="1">
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="auto"/>
  22. <RowDefinition Height="*"/>
  23. <RowDefinition Height="auto"/>
  24. </Grid.RowDefinitions>
  25. <WrapPanel
  26. Orientation="Horizontal"
  27. ItemHeight="30">
  28. <Label
  29. Content="Сортировка: "
  30. Margin="10,0,0,0"
  31. VerticalAlignment="Center"/>
  32. <ComboBox
  33. Name="SortTypeComboBox"
  34. SelectedIndex="0"
  35. VerticalContentAlignment="Center"
  36. MinWidth="200"
  37. SelectionChanged="SortTypeComboBox_SelectionChanged"
  38. ItemsSource="{Binding SortList}"/>
  39. <Label
  40. Content="Тип продукции"
  41. VerticalAlignment="Center"/>
  42. <ComboBox
  43. MinWidth="150"
  44. x:Name="ProductTypeFilter"
  45. VerticalAlignment="Center"
  46. SelectedIndex="0"
  47. SelectionChanged="ProductTypeFilter_SelectionChanged"
  48. ItemsSource="{Binding ProductTypeList}"/>
  49. <Label
  50. Content="Поиск"
  51. VerticalAlignment="Center"/>
  52. <TextBox
  53. Width="200"
  54. VerticalAlignment="Center"
  55. x:Name="SearchFilterTextBox"
  56. KeyUp="SearchFilterTextBox_KeyUp"/>
  57. <Button
  58. x:Name="CostChangeButton"
  59. Visibility="{Binding CostChangeButtonVisible}"
  60. Click="CostChangeButton_Click"
  61. Content="Изменить стоимость на..."
  62. />
  63. </WrapPanel>
  64. <ListView
  65. Grid.Row="1"
  66. Grid.Column="1"
  67. x:Name="ProductListView"
  68. SelectionChanged="ListView_SelectionChanged"
  69. MouseDoubleClick="ProductListView_MouseDoubleClick"
  70. ItemsSource="{Binding ProductList}"
  71. >
  72. <ListView.ItemContainerStyle>
  73. <Style
  74. TargetType="ListViewItem">
  75. <Setter
  76. Property="HorizontalContentAlignment"
  77. Value="Stretch" />
  78. </Style>
  79. </ListView.ItemContainerStyle>
  80. <ListView.ItemTemplate>
  81. <DataTemplate>
  82. <Border
  83. BorderThickness="1"
  84. BorderBrush="Black"
  85. Background="{Binding BackgroundColor}"
  86. CornerRadius="5">
  87. <Grid
  88. Margin="10"
  89. HorizontalAlignment="Stretch">
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition Width="64"/>
  92. <ColumnDefinition Width="*"/>
  93. <ColumnDefinition Width="auto"/>
  94. </Grid.ColumnDefinitions>
  95. <Image
  96. Width="64"
  97. Height="64"
  98. Source="{Binding ImagePreview,TargetNullValue={StaticResource defaultImage}}" />
  99. <StackPanel
  100. Grid.Column="1"
  101. Margin="5"
  102. Orientation="Vertical">
  103. <TextBlock
  104. Text="{Binding TypeAndName}"/>
  105. <TextBlock
  106. Text="{Binding ArticleNumber}"/>
  107. <TextBlock
  108. Text="{Binding MaterialString}"/>
  109. </StackPanel>
  110. <StackPanel
  111. Grid.Column="2"
  112. Margin="5"
  113. HorizontalAlignment="Right"
  114. Orientation="Vertical">
  115. <TextBlock
  116. Text="{Binding MinCostForAgent}" />
  117. <TextBlock
  118. Text="{Binding Total}" />
  119. </StackPanel>
  120. </Grid>
  121. </Border>
  122. </DataTemplate>
  123. </ListView.ItemTemplate>
  124. </ListView>
  125. <StackPanel
  126. x:Name="Paginator"
  127. Margin="5"
  128. Grid.Row="2"
  129. HorizontalAlignment="Right"
  130. Orientation="Horizontal"/>
  131. </Grid>
  132. </Grid>
  133. </Window>