<Page x:Class="Sessioa.Pages.OrderNew"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:Sessioa.Pages"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Заказы"
      FontFamily="Comic Sans MS"
      FontSize="16">
    <Page.Resources>
        <BitmapImage x:Key="defaultImage" UriSource="/Resources/picture.png"/>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.1*"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Button Name="B_Back" Content="Назад" Style="{StaticResource ButtonAct}" Margin="10,0" MaxHeight="50" MinWidth="90" MaxWidth="150" Click="B_Back_Click"  VerticalAlignment="Top" HorizontalAlignment="Left"/>
        <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right" Margin="15,0">
            <ComboBox Name="Sort" MaxHeight="60" Width="250" Margin="10,0" SelectionChanged="Sort_SelectionChanged"/>
            <ComboBox Name="Filt" MaxHeight="60" Width="250" SelectionChanged="Filt_SelectionChanged"/>
        </StackPanel>
        <ListBox x:Name="LB_OrderProduct" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="200,0" Grid.Row="1">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border BorderBrush="Black" BorderThickness="2" CornerRadius="5" Background="White" Uid="{Binding OrderID}" Loaded="Border_Loaded">
                        <Grid MouseDown="Border_MouseDown">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0.3*"/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Margin="10">
                                <TextBlock Text="{Binding OrderID, StringFormat=Заказ #{0}}" Style="{StaticResource TextBlockBold}"/>
                                <TextBlock Name="UserOrder" Loaded="UserOrder_Loaded" Style="{StaticResource TextBlock}" Uid="{Binding User.UserID}"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1" HorizontalAlignment="Right" Margin="15,0">
                                <TextBlock Text="{Binding OrderDate, StringFormat=Дата создания заказа: {0:d}}" Style="{StaticResource TextBlock}" Language="ru-RU"/>
                                <TextBlock Text="{Binding OrderDeliveryDate, StringFormat=Дата выдачи: {0:d}}" Style="{StaticResource TextBlock}" Language="ru-RU" Loaded="TextBlock_Loaded" Uid="{Binding OrderID}"/>
                                <TextBlock Name="TB_StatusOrder" Style="{StaticResource TextBlock}" Loaded="TB_StatusOrder_Loaded"  Uid="{Binding OrderID}"/>
                            </StackPanel>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Page>
