MainWindow.xaml 7.6 KB

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