MainWindow.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="PeachPuff"
  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. ItemsSource="{Binding productList}"
  28. ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="3,3,0,0" RenderTransformOrigin="0.5,0.5">
  29. <ListBox.ItemContainerStyle>
  30. <Style
  31. TargetType="ListBoxItem">
  32. <Setter
  33. Property="HorizontalContentAlignment"
  34. Value="Stretch" />
  35. </Style>
  36. </ListBox.ItemContainerStyle>
  37. <ListBox.ItemTemplate>
  38. <DataTemplate>
  39. <Border
  40. BorderThickness="1"
  41. BorderBrush="Black"
  42. Background="{Binding BackgroundColor}"
  43. CornerRadius="5">
  44. <Grid
  45. Margin="10"
  46. HorizontalAlignment="Stretch">
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="64"/>
  49. <ColumnDefinition Width="*"/>
  50. <ColumnDefinition Width="auto"/>
  51. </Grid.ColumnDefinitions>
  52. <Image
  53. Width="64"
  54. Height="64"
  55. Source="{Binding ImageBitmap}" HorizontalAlignment="Center"/>
  56. <StackPanel
  57. Grid.Column="1"
  58. Margin="5"
  59. Orientation="Vertical">
  60. <TextBlock
  61. Text="{Binding Title}"/>
  62. <TextBlock
  63. Text="{Binding ArticleNumber}"/>
  64. </StackPanel>
  65. <TextBlock
  66. Grid.Column="2"
  67. Text="{Binding ProductTypeID}"/>
  68. </Grid>
  69. </Border>
  70. </DataTemplate>
  71. </ListBox.ItemTemplate>
  72. </ListBox>
  73. <WrapPanel
  74. Grid.Column="1"
  75. Orientation="Horizontal"
  76. Background="MediumPurple"
  77. ItemHeight="50">
  78. <ComboBox
  79. Width="140"
  80. x:Name="ProductTypeFilter"
  81. SelectedIndex="0"
  82. SelectionChanged="ProductTypeFilter_SelectionChanged"
  83. ItemsSource="{Binding productTypeList}" Margin="0,15,0,15"/>
  84. <ComboBox
  85. Name="SortTypeComboBox"
  86. SelectedIndex="0"
  87. VerticalContentAlignment="Center"
  88. MinWidth="200"
  89. SelectionChanged="SortTypeComboBox_SelectionChanged"
  90. Height="20"
  91. ItemsSource="{Binding sortList}"/>
  92. <TextBox
  93. Width="200"
  94. VerticalAlignment="Center"
  95. x:Name="searchFilterTextBox"
  96. Background="Cyan"
  97. Height="30"
  98. KeyUp="searchFilterTextBox_KeyUp" TextChanged="searchFilterTextBox_TextChanged"/>
  99. </WrapPanel>
  100. <ListBox
  101. x:Name="PageListListBox"
  102. ItemsSource="{Binding pageList}"
  103. Grid.Column="1"
  104. Background="Aqua"
  105. Grid.Row="2">
  106. <ListBox.ItemsPanel>
  107. <ItemsPanelTemplate>
  108. <WrapPanel
  109. HorizontalAlignment="Left" />
  110. </ItemsPanelTemplate>
  111. </ListBox.ItemsPanel>
  112. <ListBox.ItemTemplate>
  113. <DataTemplate>
  114. <TextBlock
  115. Margin="5"
  116. Text="{Binding}"
  117. PreviewMouseDown="TextBlock_PreviewMouseDown"/>
  118. </DataTemplate>
  119. </ListBox.ItemTemplate>
  120. </ListBox>
  121. <Image
  122. Grid.Row="0"
  123. Grid.RowSpan="2"
  124. Source="foto\1.jpg"
  125. />
  126. <StackPanel
  127. Grid.Row="2"
  128. Orientation="Vertical"
  129. VerticalAlignment="Bottom">
  130. <Button
  131. x:Name="ExitButton"
  132. Content="Выход"
  133. Click="ExitButton_Click"
  134. Background="HotPink"
  135. Height="20"/>
  136. </StackPanel>
  137. <WrapPanel
  138. Orientation="Horizontal"
  139. Grid.Column="1"
  140. MinHeight="50">
  141. </WrapPanel>
  142. <Button
  143. x:Name="CostChangeButton"
  144. Visibility="{Binding costChangeButtonVisible}" Content="Изменить стоимость на..."
  145. Click="CostChangeButton_Click"
  146. Background="MediumPurple"
  147. />
  148. </Grid>
  149. </Window>