123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <Window x:Class="wpf_template.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:wpf_template"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="950">
-
- <Window.Resources>
- <BitmapImage
- x:Key='defaultImage'
- UriSource="./img/defaultPicture.jpg"/>
- </Window.Resources>
- <Grid ShowGridLines="False">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition />
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="200"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Image
- Source="assets/nagievlogo2.jpg"
- Grid.Row="1"
- Grid.RowSpan="2"
- Margin="0 0 0 85"/>
- <ListBox
- Grid.Row="1"
- Grid.Column="1"
- Background="White"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ItemsSource="{Binding ProductList}">
-
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel
- HorizontalAlignment="Center"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
-
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border
- BorderThickness="1"
- BorderBrush="Black"
- CornerRadius="5">
- <Grid
- Margin="10"
- Width="300"
- HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="64"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Image
- Width="64"
- Height="64"
- Source="{Binding ImageBitmap,TargetNullValue={StaticResource defaultImage}}"/>
- <StackPanel
- Grid.Column="1"
- Margin="5"
- Orientation="Vertical"
- VerticalAlignment="Center">
- <TextBlock
- Text="{Binding Company}"/>
- <TextBlock
- Text="{Binding Title}"/>
- </StackPanel>
- <WrapPanel
- Grid.Column="2"
- VerticalAlignment="Center"
- HorizontalAlignment="Right">
- <Label
- Content="Цена:"/>
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="{Binding Price}"/>
- </WrapPanel>
- </Grid>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <StackPanel
- Orientation="Vertical"
- Grid.RowSpan="3"
- Grid.Row="2"
- VerticalAlignment="Bottom">
- <Button
- x:Name="ExitButton"
- Content="Выход"
- Click="ExitButton_Click"
- Height="50"/>
- </StackPanel>
-
- <WrapPanel
- Orientation="Horizontal"
- Grid.Column="1"
- MinHeight="50"
- Margin="0 5 0 0">
- <Label
- Content="Категория:"
- VerticalAlignment="Center"/>
- <ComboBox
- Name="CategoryFilterComboBox"
- SelectionChanged="CategoryFilterComboBox_SelectionChanged"
- VerticalAlignment="Center"
- MinWidth="100"
- SelectedIndex="0"
- ItemsSource="{Binding CategoryList}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <Label
- Content="{Binding title}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <Label
- Content="Цена"/>
- <ComboBox
- Name ="PriceFilterComboBox"
- SelectionChanged="PriceFilterComboBox_SelectionChanged"
- VerticalAlignment="Center"
- MinWidth="100"
- SelectedIndex="0"
- ItemsSource="{Binding ProductPrices}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <Label
- Content="{Binding title}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <Label
- Content="Компания"/>
- <ComboBox
- Name ="CompanyFilterComboBox"
- SelectionChanged="CompanyFilterComboBox_SelectionChanged"
- VerticalAlignment="Center"
- MinWidth="100"
- SelectedIndex="0"
- ItemsSource="{Binding ProductCompanies}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <Label
- Content="{Binding title}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <Label
- Content="Поиск"
- VerticalAlignment="Center"/>
- <TextBox
- Width="180"
- VerticalAlignment="Center"
- x:Name="SearchFilterTextBox"
- KeyUp="SearchFilterTextBox_KeyUp"/>
- <Label
- Content="Цена:"
- VerticalAlignment="Center"/>
- <RadioButton
- GroupName="Price"
- Tag="1"
- Content="по возрастанию"
- IsChecked="True"
- Checked="RadioButton_Checked"
- VerticalAlignment="Center"/>
- <RadioButton
- GroupName="Price"
- Tag="2"
- Content="по убыванию"
- Checked="RadioButton_Checked"
- VerticalAlignment="Center"/>
- </WrapPanel>
- </Grid>
- </Window>
|