0
0

MainWindow.xaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. Title="MainWindow" Height="450" Width="800">
  9. <Grid ShowGridLines="True">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="auto"/>
  12. <RowDefinition />
  13. <RowDefinition Height="50"/>
  14. </Grid.RowDefinitions>
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="200"/>
  17. <ColumnDefinition/>
  18. </Grid.ColumnDefinitions>
  19. <ListBox
  20. Grid.Row="1"
  21. Grid.Column="1"
  22. Background="White"
  23. ItemsSource="{Binding productList}"
  24. ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="3,3,0,0" RenderTransformOrigin="0.5,0.5">
  25. <ListBox.ItemContainerStyle>
  26. <Style
  27. TargetType="ListBoxItem">
  28. <Setter
  29. Property="HorizontalContentAlignment"
  30. Value="Stretch" />
  31. </Style>
  32. </ListBox.ItemContainerStyle>
  33. <ListBox.ItemTemplate>
  34. <DataTemplate>
  35. <Border
  36. BorderThickness="1"
  37. BorderBrush="Black"
  38. CornerRadius="5">
  39. <Grid
  40. Margin="10"
  41. HorizontalAlignment="Stretch">
  42. <Grid.ColumnDefinitions>
  43. <ColumnDefinition Width="64"/>
  44. <ColumnDefinition Width="*"/>
  45. <ColumnDefinition Width="auto"/>
  46. </Grid.ColumnDefinitions>
  47. <Image
  48. Width="64"
  49. Height="64"
  50. Source="{Binding ImageBitmap}" HorizontalAlignment="Center"/>
  51. <StackPanel
  52. Grid.Column="1"
  53. Margin="5"
  54. Orientation="Vertical">
  55. <TextBlock
  56. Text="{Binding Title}"/>
  57. <TextBlock
  58. Text="{Binding ArticleNumber}"/>
  59. </StackPanel>
  60. <TextBlock
  61. Grid.Column="2"
  62. Text="{Binding ProductTypeID}"/>
  63. </Grid>
  64. </Border>
  65. </DataTemplate>
  66. </ListBox.ItemTemplate>
  67. </ListBox>
  68. <WrapPanel
  69. Grid.Column="1"
  70. Orientation="Horizontal"
  71. ItemHeight="50">
  72. <ComboBox
  73. Width="150"
  74. x:Name="ProductTypeFilter"
  75. SelectedIndex="0"
  76. SelectionChanged="ProductTypeFilter_SelectionChanged"
  77. ItemsSource="{Binding productTypeList}"/>
  78. <ComboBox
  79. Name="SortTypeComboBox"
  80. SelectedIndex="0"
  81. VerticalContentAlignment="Center"
  82. MinWidth="200"
  83. SelectionChanged="SortTypeComboBox_SelectionChanged"
  84. ItemsSource="{Binding sortList}"/>
  85. <TextBox
  86. Width="200"
  87. VerticalAlignment="Center"
  88. x:Name="searchFilterTextBox"
  89. KeyUp="searchFilterTextBox_KeyUp"/>
  90. </WrapPanel>
  91. <ListBox
  92. x:Name="PageListListBox"
  93. ItemsSource="{Binding pageList}"
  94. Grid.Column="1"
  95. Grid.Row="2">
  96. <ListBox.ItemsPanel>
  97. <ItemsPanelTemplate>
  98. <WrapPanel
  99. HorizontalAlignment="Left" />
  100. </ItemsPanelTemplate>
  101. </ListBox.ItemsPanel>
  102. <ListBox.ItemTemplate>
  103. <DataTemplate>
  104. <TextBlock
  105. Margin="5"
  106. Text="{Binding}"
  107. PreviewMouseDown="TextBlock_PreviewMouseDown"/>
  108. </DataTemplate>
  109. </ListBox.ItemTemplate>
  110. </ListBox>
  111. <Image
  112. Grid.Row="0"
  113. Grid.RowSpan="2"
  114. Source="foto/1.jpg"
  115. />
  116. <StackPanel
  117. Grid.Row="2"
  118. Orientation="Vertical"
  119. VerticalAlignment="Bottom">
  120. <Button
  121. x:Name="ExitButton"
  122. Content="Выход"
  123. Click="ExitButton_Click"
  124. Height="54"/>
  125. </StackPanel>
  126. <WrapPanel
  127. Orientation="Horizontal"
  128. Grid.Column="1"
  129. MinHeight="50">
  130. </WrapPanel>
  131. </Grid>
  132. </Window>