<Page x:Class="ComputerShopWpf.Views.OrderItemsPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="Состав заказа">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <DockPanel>
            <Button x:Name="BackButton" Content="Назад" Click="BackButton_Click" DockPanel.Dock="Left"/>
            <TextBlock x:Name="OrderInfoTextBlock"
                       Style="{StaticResource PageTitleStyle}"
                       VerticalAlignment="Center"
                       TextWrapping="Wrap"
                       Margin="10,0,0,8"/>
        </DockPanel>

        <DataGrid x:Name="OrderItemsDataGrid" Grid.Row="1">
            <DataGrid.Columns>
                <DataGridTextColumn Header="ID" Binding="{Binding [order_item_id]}" Width="70"/>
                <DataGridTextColumn Header="Товар" Binding="{Binding [product_name]}" Width="*"/>
                <DataGridTextColumn Header="Категория" Binding="{Binding [category]}" Width="170"/>
                <DataGridTextColumn Header="Цена" Binding="{Binding [unit_price], StringFormat={}{0:N2}}" Width="120"/>
                <DataGridTextColumn Header="Количество" Binding="{Binding [quantity]}" Width="120"/>
                <DataGridTextColumn Header="Сумма" Binding="{Binding [item_sum], StringFormat={}{0:N2}}" Width="130"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>
