123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <Window x:Class="OOOWriteAndClear.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:OOOWriteAndClear"
- xmlns:db_models="clr-namespace:OOOWriteAndClear.DataBase"
- mc:Ignorable="d" Icon="/Resources/Images/icon.ico"
- Title="Пиши-стирай" Height="450" Width="800">
- <Window.Resources>
- <Style x:Key="MainItemsListView" TargetType="ListView">
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate DataType="db_models:Product">
- <Grid Background="{Binding ItemBackground}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Height="80" Width="80" Margin="0 0 10 0"
- Source="{Binding ImagePath}"/>
- <Grid Grid.Column="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
-
- <TextBlock Grid.Row="0" Text="{Binding ProductName}"/>
- <TextBlock Grid.Row="1" Text="{Binding ProductDescription}" TextWrapping="Wrap"/>
- <TextBlock Grid.Row="2" Text="{Binding Manufacturer.ManufacturerName, StringFormat=Производитель: {0}}"/>
- <StackPanel Orientation="Horizontal" Grid.Row="3">
- <TextBlock Text="Цена: "/>
- <TextBlock Text="{Binding ProductCost}"
- TextDecorations="Strikethrough"/>
- <TextBlock Text="{Binding CostWithDiscount, StringFormat={} {0:f2} руб.}"/>
- </StackPanel>
-
- </Grid>
- <TextBlock Grid.Column="2" Text="{Binding ProductDiscountMax, StringFormat={}{0:f2}%}" VerticalAlignment="Center"/>
- </Grid>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Window.Resources>
-
- <Border Padding="10" Name="MainBorder">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <TextBlock Grid.Row="0"
- Text="Товары" HorizontalAlignment="Center"
- FontWeight="Bold"/>
- <Button HorizontalAlignment="Right" Height="30" Content="В корзину" Click="Button_Click_1"/>
- <Button Grid.Row="0" HorizontalAlignment="Left"
- BorderThickness="0" Background="Red"
- Foreground="White"
- Height="30" Width="30" Click="Button_Click">X</Button>
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <GroupBox Grid.Column="0" Header="Фильтрация по размеру скидки"
- Margin="0 0 10 0" >
- <ComboBox x:Name="FiltringCB" SelectionChanged="FiltringCB_SelectionChanged">
- <ComboBoxItem>Все диапазоны</ComboBoxItem>
- <ComboBoxItem>0-9,99%</ComboBoxItem>
- <ComboBoxItem>10-14,99%</ComboBoxItem>
- <ComboBoxItem>15% и более</ComboBoxItem>
- </ComboBox>
- </GroupBox>
- <GroupBox Grid.Column="1" Header="Сортировка по стоимости"
- Margin="0 0 10 0">
- <ComboBox x:Name="SortingCB" SelectionChanged="SortingCB_SelectionChanged">
- <ComboBoxItem>По возрастанию</ComboBoxItem>
- <ComboBoxItem>По убыванию</ComboBoxItem>
- </ComboBox>
- </GroupBox>
- <GroupBox Grid.Column="2" Width="300"
- Header="Поиск">
- <TextBox BorderThickness="0" x:Name="FindingTB" TextChanged="FindingTB_TextChanged"/>
- </GroupBox>
- </Grid>
- <ListView Name="ItemsListView"
- Grid.Row="2" Margin="0 10 0 0" d:ItemsSource="{d:SampleData ItemCount=5}"
- Style="{StaticResource MainItemsListView}" HorizontalContentAlignment="Stretch">
- <ListView.ContextMenu>
- <ContextMenu>
- <MenuItem Header="Добавить в заказ" Click="MenuItem_Click"></MenuItem>
- </ContextMenu>
- </ListView.ContextMenu>
-
- </ListView>
- </Grid>
- </Border>
- </Window>
|