12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <Window x:Class="trade_akapralov.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:trade_akapralov"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Grid ShowGridLines="True">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition/>
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="200"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <!-- ListBox с привязкой данных -->
- <ListBox
- Grid.Row="1"
- Grid.Column="1"
- Background="White"
- ItemsSource="{Binding ProductList}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- Margin="3,3,0,0" RenderTransformOrigin="0.5,0.5">
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border BorderThickness="1" BorderBrush="Black" CornerRadius="5">
- <Grid Margin="10" HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="64"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <!-- Изображение продукта -->
- <Image Width="64" Height="64"
- HorizontalAlignment="Center">
- <Image.Source>
- <BitmapImage UriSource="{Binding ProductPhotoPath}" />
- </Image.Source>
- </Image>
- <!-- Данные продукта -->
- <StackPanel Grid.Column="1" Margin="5" Orientation="Vertical">
- <TextBlock Text="{Binding ProductDescription}" FontWeight="Bold" />
- <TextBlock Text="{Binding ManufacturerName}" />
- <TextBlock Text="{Binding ProductCost}" />
- </StackPanel>
- <!-- Производитель -->
- <TextBlock Grid.Column="2"
- Text="{Binding ProductQuantityInStock}"
- VerticalAlignment="Center"/>
- </Grid>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <!-- Логотип -->
- <Image Source="/logo/Logo.png" Grid.RowSpan="2"/>
- <StackPanel Orientation="Vertical" Grid.RowSpan="3" VerticalAlignment="Bottom">
- <Button x:Name="ExitButton" Content="Выход" Click="ExitButton_Click" Height="54"/>
- </StackPanel>
- </Grid>
- </Window>
|