MainWindow.xaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <Window x:Class="WpfApp3.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:WpfApp3"
  7. mc:Ignorable="d"
  8. Title="Musical Store" Height="450" Width="800">
  9. <Window.Resources>
  10. <BitmapImage
  11. x:Key="defaultImage"
  12. UriSource="./Images/20.-1.png"/>
  13. </Window.Resources>
  14. <Grid ShowGridLines="True">
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="Auto" />
  17. <RowDefinition Height="*" />
  18. <RowDefinition Height="Auto" />
  19. </Grid.RowDefinitions>
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="200"/>
  22. <ColumnDefinition/>
  23. </Grid.ColumnDefinitions>
  24. <Image
  25. Source="./assets/Guitar.jpg" HorizontalAlignment="Right" Margin="0,51,34,47" Width="135" RenderTransformOrigin="0.5,0.5" Grid.RowSpan="2">
  26. <Image.RenderTransform>
  27. <TransformGroup>
  28. <ScaleTransform/>
  29. <SkewTransform/>
  30. <RotateTransform Angle="-46.766"/>
  31. <TranslateTransform/>
  32. </TransformGroup>
  33. </Image.RenderTransform>
  34. </Image>
  35. <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="10">
  36. <Label Content="Фильтр:" VerticalAlignment="Center" />
  37. <ComboBox x:Name="FilterComboBox" SelectionChanged="FilterComboBox_SelectionChanged" Margin="10" />
  38. <Label Content="Поиск:" VerticalAlignment="Center" />
  39. <TextBox Width="200" VerticalAlignment="Center" x:Name="SearchFilterTextBox" KeyUp="SearchFilter_KeyUp"/>
  40. </StackPanel>
  41. <StackPanel Grid.Column="1" Orientation="Vertical" Grid.Row="2" VerticalAlignment="Bottom">
  42. <RadioButton GroupName="Sort" Tag="1" Content="по возрастанию" Checked="RadioButtonAsc_Checked" VerticalAlignment="Center"/>
  43. <RadioButton GroupName="Sort" Tag="2" Content="по убыванию" Checked="RadioButtonDesc_Checked" VerticalAlignment="Center"/>
  44. <Button x:Name="ExitButton" Content="Выход" Click="ExitButton_Click" Height="50"/>
  45. </StackPanel>
  46. <ListBox x:Name="InstrumentListView"
  47. Grid.Row="1"
  48. Background="White"
  49. ItemsSource="{Binding InstrumentListView}" Grid.Column="1">
  50. <ListBox.ItemContainerStyle>
  51. <Style
  52. TargetType="ListBoxItem">
  53. <Setter
  54. Property="HorizontalContentAlignment"
  55. Value="Stretch" />
  56. </Style>
  57. </ListBox.ItemContainerStyle>
  58. <ListBox.ItemTemplate>
  59. <DataTemplate>
  60. <Border
  61. BorderThickness="1"
  62. BorderBrush="Black"
  63. CornerRadius="5">
  64. <Grid
  65. Margin="10"
  66. HorizontalAlignment="Stretch">
  67. <Grid.ColumnDefinitions>
  68. <ColumnDefinition Width="64"/>
  69. <ColumnDefinition Width="*"/>
  70. <ColumnDefinition Width="auto"/>
  71. </Grid.ColumnDefinitions>
  72. <Image
  73. Width="64"
  74. Height="64"
  75. Source="{Binding ImageBitmap,TargetNullValue={StaticResource defaultImage}}" />
  76. <StackPanel
  77. Grid.Column="1"
  78. Margin="5"
  79. Orientation="Vertical">
  80. <TextBlock
  81. Text="{Binding Name}"/>
  82. <TextBlock
  83. Text="{Binding Brand}"/>
  84. <TextBlock
  85. Grid.Column="2"
  86. Text="{Binding Price}"/>
  87. </StackPanel>
  88. </Grid>
  89. </Border>
  90. </DataTemplate>
  91. </ListBox.ItemTemplate>
  92. </ListBox>
  93. </Grid>
  94. </Window>