MainWindow.xaml 7.8 KB

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