MainWindow.xaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <Window x:Class="wpf_connection3.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:wpf_connection3"
  7. mc:Ignorable="d"
  8. Background="Pink"
  9. Title="MainWindow" Height="450" Width="800">
  10. <Grid ShowGridLines="True">
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="auto"/>
  13. <RowDefinition />
  14. <RowDefinition Height="50"/>
  15. </Grid.RowDefinitions>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="200"/>
  18. <ColumnDefinition/>
  19. </Grid.ColumnDefinitions>
  20. <ListBox
  21. Name="ProductListBox"
  22. SelectionMode="Multiple"
  23. SelectionChanged="ProductListBox_OnSelectionChanged"
  24. Grid.Row="1"
  25. Grid.Column="1"
  26. Background="White"
  27. MouseDoubleClick="ProductListBox_MouseDoubleClick"
  28. ItemsSource="{Binding productList}"
  29. ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="3,3,0,0" RenderTransformOrigin="0.5,0.5">
  30. <ListBox.ItemContainerStyle>
  31. <Style
  32. TargetType="ListBoxItem">
  33. <Setter
  34. Property="HorizontalContentAlignment"
  35. Value="Stretch" />
  36. </Style>
  37. </ListBox.ItemContainerStyle>
  38. <ListBox.ItemTemplate>
  39. <DataTemplate>
  40. <Border
  41. BorderThickness="1"
  42. BorderBrush="Black"
  43. Background="{Binding BackgroundColor}"
  44. CornerRadius="5">
  45. <Grid
  46. Margin="10"
  47. HorizontalAlignment="Stretch">
  48. <Grid.ColumnDefinitions>
  49. <ColumnDefinition Width="64"/>
  50. <ColumnDefinition Width="*"/>
  51. <ColumnDefinition Width="auto"/>
  52. </Grid.ColumnDefinitions>
  53. <Image
  54. Width="64"
  55. Height="64"
  56. Source="{Binding ImageBitmap}" HorizontalAlignment="Center"/>
  57. <StackPanel
  58. Grid.Column="1"
  59. Margin="5"
  60. Orientation="Vertical">
  61. <TextBlock
  62. Text="{Binding Title}"/>
  63. <TextBlock
  64. Text="{Binding ArticleNumber}"/>
  65. </StackPanel>
  66. <TextBlock
  67. Grid.Column="2"
  68. Text="{Binding ProductTypeID}"/>
  69. </Grid>
  70. </Border>
  71. </DataTemplate>
  72. </ListBox.ItemTemplate>
  73. </ListBox>
  74. <WrapPanel
  75. Grid.Column="1"
  76. Orientation="Horizontal"
  77. Background="Pink"
  78. ItemHeight="50">
  79. <ComboBox
  80. Width="150"
  81. x:Name="ProductTypeFilter"
  82. SelectedIndex="0"
  83. SelectionChanged="ProductTypeFilter_SelectionChanged"
  84. ItemsSource="{Binding productTypeList}" Margin="0,15,0,15"/>
  85. <ComboBox
  86. Name="SortTypeComboBox"
  87. SelectedIndex="0"
  88. VerticalContentAlignment="Center"
  89. MinWidth="200"
  90. SelectionChanged="SortTypeComboBox_SelectionChanged"
  91. Height="20"
  92. ItemsSource="{Binding sortList}"/>
  93. <TextBox
  94. Width="200"
  95. VerticalAlignment="Center"
  96. x:Name="searchFilterTextBox"
  97. Background="White"
  98. Height="30"
  99. KeyUp="searchFilterTextBox_KeyUp"/>
  100. <Button
  101. Name="AddProductButton"
  102. Content="Добавить продукт"
  103. Margin="5"
  104. Click="AddProductButton_Click"/>
  105. </WrapPanel>
  106. <ListBox
  107. x:Name="PageListListBox"
  108. ItemsSource="{Binding pageList}"
  109. Grid.Column="1"
  110. Background="White"
  111. Grid.Row="2">
  112. <ListBox.ItemsPanel>
  113. <ItemsPanelTemplate>
  114. <WrapPanel
  115. HorizontalAlignment="Left" />
  116. </ItemsPanelTemplate>
  117. </ListBox.ItemsPanel>
  118. <ListBox.ItemTemplate>
  119. <DataTemplate>
  120. <TextBlock
  121. Margin="5"
  122. Text="{Binding}"
  123. PreviewMouseDown="TextBlock_PreviewMouseDown"/>
  124. </DataTemplate>
  125. </ListBox.ItemTemplate>
  126. </ListBox>
  127. <Image
  128. Grid.Row="0"
  129. Grid.RowSpan="2"
  130. Source="logotire/extasy.jpg"
  131. />
  132. <StackPanel
  133. Grid.Row="2"
  134. Orientation="Vertical"
  135. VerticalAlignment="Bottom">
  136. <Button
  137. x:Name="ExitButton"
  138. Content="Выход"
  139. Click="ExitButton_Click"
  140. Background="SkyBlue"
  141. Height="20"/>
  142. </StackPanel>
  143. <WrapPanel
  144. Orientation="Horizontal"
  145. Grid.Column="1"
  146. MinHeight="50">
  147. </WrapPanel>
  148. <Button
  149. x:Name="CostChangeButton"
  150. Visibility="{Binding costChangeButtonVisible}" Content="Изменить стоимость на..."
  151. Click="CostChangeButton_Click"
  152. Background="Pink"
  153. />
  154. </Grid>
  155. </Window>