<Window x:Class="Kafe.Windows.OrderWindow"
        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:Kafe.Windows"
        mc:Ignorable="d"
        Title="Заказы" Height="450" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Grid>
        <ListView Name="OrderList" HorizontalContentAlignment="Stretch">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Border BorderThickness="1" BorderBrush="Black">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <TextBlock Text="{Binding ID, StringFormat=Заказ №{0}}"/>

                            <StackPanel Orientation="Horizontal"  Grid.Column ="1">
                                <TextBlock Text="Блюда: "/>
                                <ItemsControl ItemsSource="{Binding DishOrder}">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Dish.Title}"/>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </StackPanel>

                            <TextBlock Grid.Row="0" Grid.Column="2">
                                <TextBlock.Text>
                                    <MultiBinding StringFormat="Столик №{0} Количество клиентов: {1}">
                                        <Binding Path="TableNumber"/>
                                        <Binding Path="ClientCount"/>
                                    </MultiBinding>
                                </TextBlock.Text>
                            </TextBlock>

                            <TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding Cost, StringFormat=Стоимость заказа: {0} руб.}"/>

                            <WrapPanel Orientation="Horizontal" Grid.Row="2">
                                <TextBlock Text="Офицант: "/>
                                <TextBlock >
                                    <TextBlock.Text>
                                        <MultiBinding StringFormat="{}{0} {1} {2}">
                                            <Binding Path="Employee.LastName"/>
                                            <Binding Path="Employee.FirstName"/>
                                            <Binding Path="Employee.MiddleName"/>
                                        </MultiBinding>
                                    </TextBlock.Text>
                                </TextBlock>

                            </WrapPanel>
                            <TextBlock Grid.Row="2" Grid.Column="1">
                                <TextBlock.Text>
                                    <MultiBinding StringFormat="Статус заказа: {0}, {1}">
                                        <Binding Path="PayStatus.Title"/>
                                        <Binding Path="CookStatus.Title"/>
                                    </MultiBinding>
                                </TextBlock.Text>
                            </TextBlock>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</Window>
