MainWindow.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <Window x:Class="mysql_connector2.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_connector2"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <Window.Resources>
  10. <Style x:Key="VerticalListBoxStyle" TargetType="ListBox">
  11. <Setter Property="ItemsPanel">
  12. <Setter.Value>
  13. <ItemsPanelTemplate>
  14. <StackPanel Orientation="Vertical"/>
  15. </ItemsPanelTemplate>
  16. </Setter.Value>
  17. </Setter>
  18. <Setter Property="ItemTemplate">
  19. <Setter.Value>
  20. <DataTemplate>
  21. <Border
  22. BorderThickness="2"
  23. BorderBrush="Black"
  24. CornerRadius="4"
  25. Margin="4"
  26. Background="{Binding BackgroundColor}">
  27. <Grid>
  28. <Grid.RowDefinitions>
  29. <RowDefinition Height="Auto"/>
  30. <RowDefinition Height="Auto"/>
  31. <RowDefinition Height="*"/>
  32. </Grid.RowDefinitions>
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition Width="64"/>
  35. <ColumnDefinition Width="*"/>
  36. <ColumnDefinition Width="auto"/>
  37. </Grid.ColumnDefinitions>
  38. <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
  39. <Image Width="88" Height="88" Source="{Binding ImageBitmap}" />
  40. <StackPanel Orientation="Vertical" Margin="10,0,0,0">
  41. <StackPanel Orientation="Horizontal">
  42. <TextBlock Margin="0" Text="{Binding ProductTypeTitle}" FontSize="14"/>
  43. <TextBlock Margin="5,0" Text=" | " />
  44. <TextBlock Margin="0" Text="{Binding Title}" FontSize="14"/>
  45. </StackPanel>
  46. <TextBlock Margin="0" Text="{Binding ArticleNumber}" HorizontalAlignment="Left" FontSize="12" />
  47. <TextBlock Margin="0" Text="{Binding MaterialString}" FontSize="11"/>
  48. </StackPanel>
  49. </StackPanel>
  50. <TextBlock Margin="0,2,10,0" Grid.Column="2" Text="{Binding MaterialCost}" FontSize="13" HorizontalAlignment="Right"/>
  51. </Grid>
  52. </Border>
  53. </DataTemplate>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. <Style x:Key="TileListBoxStyle" TargetType="ListBox">
  58. <Setter Property="ItemsPanel">
  59. <Setter.Value>
  60. <ItemsPanelTemplate>
  61. <WrapPanel HorizontalAlignment="Center" ItemWidth="200"/>
  62. </ItemsPanelTemplate>
  63. </Setter.Value>
  64. </Setter>
  65. <Setter Property="ItemTemplate">
  66. <Setter.Value>
  67. <DataTemplate>
  68. <Border BorderThickness="1" BorderBrush="Black" CornerRadius="5" Margin="5" Height="270">
  69. <Grid>
  70. <Grid.RowDefinitions>
  71. <RowDefinition Height="Auto"/>
  72. <RowDefinition Height="Auto"/>
  73. <RowDefinition Height="*"/>
  74. </Grid.RowDefinitions>
  75. <Image Margin="0,20,0,0" Width="120" Height="120" Source="{Binding ImageBitmap}" Grid.Row="0" HorizontalAlignment="Center" />
  76. <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Center">
  77. <TextBlock Text="{Binding ProductTypeTitle}" TextAlignment="Center" TextWrapping="Wrap"/>
  78. <TextBlock Text="{Binding Title}" TextAlignment="Center" TextWrapping="Wrap"/>
  79. <TextBlock Text="{Binding ArticleNumber}" TextAlignment="Center" TextWrapping="Wrap"/>
  80. <TextBlock Text="{Binding MaterialCost}" TextAlignment="Center" TextWrapping="Wrap"/>
  81. <TextBlock Text="{Binding MaterialString}" TextAlignment="Center" TextWrapping="Wrap"/>
  82. </StackPanel>
  83. </Grid>
  84. </Border>
  85. </DataTemplate>
  86. </Setter.Value>
  87. </Setter>
  88. </Style>
  89. </Window.Resources>
  90. <Grid ShowGridLines="True">
  91. <Grid.RowDefinitions>
  92. <RowDefinition Height="auto"/>
  93. <RowDefinition />
  94. <RowDefinition Height="auto"/>
  95. </Grid.RowDefinitions>
  96. <Grid.ColumnDefinitions>
  97. <ColumnDefinition Width="200"/>
  98. <ColumnDefinition/>
  99. </Grid.ColumnDefinitions>
  100. <Image
  101. Source="/bin/Debug/net8.0-windows/logo/Logo.jpg"
  102. Grid.RowSpan="2" HorizontalAlignment="Right"/>
  103. <ListBox
  104. Name="ProductListBox"
  105. SelectionMode="Multiple"
  106. SelectionChanged="ProductListBox_SelectionChanged"
  107. PreviewMouseDoubleClick="ProductListView_MouseDoubleClick"
  108. Style="{StaticResource VerticalListBoxStyle}"
  109. Grid.Row="1"
  110. Grid.Column="1"
  111. Background="White"
  112. ItemsSource="{Binding productList}"
  113. ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
  114. <ListBox.ItemContainerStyle>
  115. <Style
  116. TargetType="ListBoxItem">
  117. <Setter
  118. Property="HorizontalContentAlignment"
  119. Value="Stretch" />
  120. </Style>
  121. </ListBox.ItemContainerStyle>
  122. </ListBox>
  123. <StackPanel
  124. Orientation="Vertical"
  125. Grid.RowSpan="3"
  126. VerticalAlignment="Bottom">
  127. <Button
  128. x:Name="ExitButton"
  129. Content="Выход"
  130. Click="ExitButton_Click"
  131. Height="50"/>
  132. </StackPanel>
  133. <WrapPanel
  134. Orientation="Horizontal"
  135. Grid.Column="1"
  136. MinHeight="50">
  137. <Button
  138. x:Name="CostChangeButton"
  139. Visibility="{Binding costChangeButtonVisible}"
  140. Click="CostChangeButton_Click"
  141. Content="Изменить стоимость на..."/>
  142. <ListBox Margin="5"
  143. x:Name="PageListListBox"
  144. ItemsSource="{Binding pageList}"
  145. Grid.Column="1"
  146. Grid.Row="2">
  147. <ListBox.ItemsPanel>
  148. <ItemsPanelTemplate>
  149. <WrapPanel
  150. HorizontalAlignment="Right"></WrapPanel>
  151. </ItemsPanelTemplate>
  152. </ListBox.ItemsPanel>
  153. <ListBox.ItemTemplate>
  154. <DataTemplate>
  155. <TextBlock
  156. Margin="5"
  157. Text="{Binding}"
  158. PreviewMouseDown="TextBlock_PreviewMouseDown"/>
  159. </DataTemplate>
  160. </ListBox.ItemTemplate>
  161. </ListBox>
  162. <ComboBox
  163. Name="SortTypeComboBox"
  164. SelectedIndex="0"
  165. VerticalContentAlignment="Center"
  166. Width="210" Height="30" Margin="10,0,10,0"
  167. SelectionChanged="SortTypeComboBox_SelectionChanged"
  168. ItemsSource="{Binding sortList}"/>
  169. <ComboBox
  170. Width="120" Height="30"
  171. x:Name="ProductTypeFilter"
  172. SelectedIndex="0"
  173. SelectionChanged="ProductTypeFilter_SelectionChanged"
  174. ItemsSource="{Binding productTypeList}"/>
  175. <Label
  176. Content="Поиск"
  177. VerticalAlignment="Center"/>
  178. <TextBox
  179. Width="200"
  180. VerticalAlignment="Center"
  181. x:Name="searchFilterTextBox"
  182. KeyUp="SearchFilterTextBox_OnKeyUp"/>
  183. </WrapPanel>
  184. </Grid>
  185. </Window>