MainWindow.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. Style="{StaticResource VerticalListBoxStyle}"
  108. Grid.Row="1"
  109. Grid.Column="1"
  110. Background="White"
  111. ItemsSource="{Binding productList}"
  112. ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
  113. <ListBox.ItemContainerStyle>
  114. <Style
  115. TargetType="ListBoxItem">
  116. <Setter
  117. Property="HorizontalContentAlignment"
  118. Value="Stretch" />
  119. </Style>
  120. </ListBox.ItemContainerStyle>
  121. </ListBox>
  122. <StackPanel
  123. Orientation="Vertical"
  124. Grid.RowSpan="3"
  125. VerticalAlignment="Bottom">
  126. <Button
  127. x:Name="ExitButton"
  128. Content="Выход"
  129. Click="ExitButton_Click"
  130. Height="50"/>
  131. </StackPanel>
  132. <WrapPanel
  133. Orientation="Horizontal"
  134. Grid.Column="1"
  135. MinHeight="50">
  136. <Button
  137. x:Name="CostChangeButton"
  138. Visibility="{Binding costChangeButtonVisible}"
  139. Click="CostChangeButton_Click"
  140. Content="Изменить стоимость на..."/>
  141. <ListBox Margin="5"
  142. x:Name="PageListListBox"
  143. ItemsSource="{Binding pageList}"
  144. Grid.Column="1"
  145. Grid.Row="2">
  146. <ListBox.ItemsPanel>
  147. <ItemsPanelTemplate>
  148. <WrapPanel
  149. HorizontalAlignment="Right"></WrapPanel>
  150. </ItemsPanelTemplate>
  151. </ListBox.ItemsPanel>
  152. <ListBox.ItemTemplate>
  153. <DataTemplate>
  154. <TextBlock
  155. Margin="5"
  156. Text="{Binding}"
  157. PreviewMouseDown="TextBlock_PreviewMouseDown"/>
  158. </DataTemplate>
  159. </ListBox.ItemTemplate>
  160. </ListBox>
  161. <ComboBox
  162. Name="SortTypeComboBox"
  163. SelectedIndex="0"
  164. VerticalContentAlignment="Center"
  165. Width="210" Height="30" Margin="10,0,10,0"
  166. SelectionChanged="SortTypeComboBox_SelectionChanged"
  167. ItemsSource="{Binding sortList}"/>
  168. <ComboBox
  169. Width="120" Height="30"
  170. x:Name="ProductTypeFilter"
  171. SelectedIndex="0"
  172. SelectionChanged="ProductTypeFilter_SelectionChanged"
  173. ItemsSource="{Binding productTypeList}"/>
  174. <Label
  175. Content="Поиск"
  176. VerticalAlignment="Center"/>
  177. <TextBox
  178. Width="200"
  179. VerticalAlignment="Center"
  180. x:Name="searchFilterTextBox"
  181. KeyUp="SearchFilterTextBox_OnKeyUp"/>
  182. </WrapPanel>
  183. </Grid>
  184. </Window>