123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <Window x:Class="OOOWriteAndClear.Basket"
- 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"
- Title="Basket" Height="450" Width="800">
- <Window.Resources>
- <Style x:Key="BasketSostavListView" TargetType="ListView">
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate DataType="db_models:OrderProduct">
- <Grid>
- <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 Product.ImagePath}"/>
- <Grid Grid.Column="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <TextBlock Grid.Row="0" Text="{Binding Product.ProductName}"/>
- <TextBlock Grid.Row="1" Text="{Binding Product.ProductDescription}" TextWrapping="Wrap"/>
- <TextBlock Grid.Row="2" Text="{Binding Product.Manufacturer.ManufacturerName, StringFormat=Производитель: {0}}"/>
- <TextBlock Grid.Row="3" Text="{Binding Product.ProductCost, StringFormat=Цена без скидки: {0:f2} руб.}"/>
- <TextBlock Grid.Row="4" Text="{Binding Product.CostWithDiscount, StringFormat=Цена со скидкой: {0:f2} руб.}"/>
- </Grid>
- <StackPanel Orientation="Vertical" Grid.Column="2" VerticalAlignment="Center">
- <Button Uid="{Binding Product.ProductArticleNumber}"
- Click="Button_Click"
- Content="+"
- Height="20"
- Width="20"/>
- <TextBlock Text="{Binding ProductAmount}" HorizontalAlignment="Center"/>
- <Button Uid="{Binding Product.ProductArticleNumber}"
- Click="Button_Click_1"
- Content="-"
- Height="20"
- Width="20"/>
- </StackPanel>
- </Grid>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Window.Resources>
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <Border Padding="10">
- <ListView Name="BasketListView" Grid.Column="0" BorderThickness="0" Style="{StaticResource BasketSostavListView}"
- d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalContentAlignment="Stretch"/>
- </Border>
- <Grid Grid.Column="1" Width="160">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <GroupBox Margin="0 20 0 0" Grid.Row="0" Header="Цена без скидки" Height="40">
- <TextBlock x:Name="CostWithoutDisc"/>
- </GroupBox>
- <GroupBox Margin="0 10 0 0" Grid.Row="1" Header="Размер скидки" Height="40">
- <TextBlock x:Name="Disc"/>
- </GroupBox>
- <GroupBox Margin="0 10 0 0" Grid.Row="2" Header="Цена со скидкой" Height="40">
- <TextBlock x:Name="CostWithDisc"/>
- </GroupBox>
- </Grid>
- </Grid>
- </Window>
|