MainWindow.xaml 8.3 KB

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