<Page x:Class="MyMoviesWPF.MVVM.View.Pages.CartPage"
      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:MyMoviesWPF.MVVM.View.Pages"
      mc:Ignorable="d" 
      d:DesignHeight="900" d:DesignWidth="1600"
      Title="CartPage">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="190*"/>
            <RowDefinition Height="40*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="206*" />

            <ColumnDefinition Width="593*"/>
            <ColumnDefinition Width="0*"/>
        </Grid.ColumnDefinitions>
        <Button Content="Перейти к оплате" 
                HorizontalAlignment="Center" VerticalAlignment="Center"
                Grid.Row="1" Grid.Column="1" Height="75" Width="250"/>
        <Button Content="Отмена" 
                HorizontalAlignment="Right" VerticalAlignment="Center"
                Grid.Row="1" Grid.Column="2" Height="75" Width="250" />
        <DataGrid ItemsSource="{Binding CartMoviesCollection}" SelectedItem="{Binding RemoveMovie}" Grid.Column="1" IsReadOnly="True"/>
        <DataGrid ItemsSource="{Binding CartMoviesCollection}" HeadersVisibility="None"
                    Grid.Column="2" IsReadOnly="True" AutoGenerateColumns="False" BorderBrush = "Transparent" Background = "Transparent" RowBackground = "Transparent">
            <DataGrid.LayoutTransform>
                <TransformGroup>
                    <RotateTransform Angle="90"/>
                    <MatrixTransform Matrix="-1,0,0,1,0,0"/>
                </TransformGroup>
            </DataGrid.LayoutTransform>
            <DataGrid.ColumnHeaderStyle>
                <Style TargetType="{x:Type DataGridColumnHeader}"
                            BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                    <Setter Property="LayoutTransform">
                        <Setter.Value>
                            <TransformGroup>
                                <RotateTransform Angle="-90"/>
                                <ScaleTransform ScaleX="1" ScaleY="-1" />
                            </TransformGroup>
                        </Setter.Value>
                    </Setter>
                </Style>
            </DataGrid.ColumnHeaderStyle>
            <DataGrid.CellStyle>
                <Style  TargetType="DataGridCell">
                    <Setter Property="LayoutTransform">
                        <Setter.Value>
                            <TransformGroup>
                                <RotateTransform Angle="-90"/>
                                <ScaleTransform ScaleX="1" ScaleY="-1" />
                            </TransformGroup>
                        </Setter.Value>
                    </Setter>
                </Style>
            </DataGrid.CellStyle>
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="File Type" Width="200">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="200" Width="200" Source="{Binding Image}" Stretch="Uniform" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="Название" Binding="{Binding Name}" IsReadOnly="True"></DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>
