<UserControl x:Class="Hearthstone_Deck_Tracker.Utility.Toasts.ToastControls.GameResultToast"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             Background="{DynamicResource AccentColorBrush}"
             Unloaded="GameResultToast_OnUnloaded" MinHeight="32" MinWidth="250">
    <StackPanel>
        <DockPanel Visibility="{Binding ShowDetails, Converter={StaticResource InverseBoolToVisibility}}"
                   MouseLeftButtonUp="PanelSummary_MouseLeftButtonUp">
            <StackPanel HorizontalAlignment="Center" Height="32" Orientation="Horizontal">
                <Image Source="{Binding PlayerClassImage}" RenderOptions.BitmapScalingMode="Fant" Margin="2"/>
                <TextBlock Text="vs" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="5,0"/>
                <Image Source="{Binding Opponent.ClassImage}" RenderOptions.BitmapScalingMode="Fant" Margin="2"/>
                <Rectangle Width="1" Fill="White" Margin="5,3"/>
                <TextBlock Text="{Binding Result}" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center"/>
                <Rectangle Width="1" Fill="White"  Margin="5,3"/>
                <TextBlock Text="{Binding Mode, StringFormat='{}{0}'}"  FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" />
                <TextBlock Text="{Binding Format, StringFormat='{}{0}'}"  FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="5,0,0,0"/>
            </StackPanel>
        </DockPanel>
        <DockPanel DockPanel.Dock="Top" Background="{DynamicResource AccentColorBrush}" Height="32"
                   Visibility="{Binding ShowDetails, Converter={StaticResource BoolToVisibility}}">
            <Rectangle Width="18" Height="18" Opacity="0.8" DockPanel.Dock="Left" Margin="8,0,0,0" MouseDown="RectangleSettings_OnMouseDown">
                <Rectangle.Style>
                    <Style>
                        <Style.Triggers>
                            <Trigger Property="Rectangle.IsMouseOver" Value="False">
                                <Setter Property="Rectangle.Opacity" Value="0.5" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Rectangle.Style>
                <Rectangle.Fill>
                    <VisualBrush Visual="{StaticResource appbar_settings}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Rectangle Width="18" Height="18" Opacity="0.8" DockPanel.Dock="Right" Margin="0,0,8,0" MouseDown="RectangleClose_OnMouseDown">
                <Rectangle.Style>
                    <Style>
                        <Style.Triggers>
                            <Trigger Property="Rectangle.IsMouseOver" Value="False">
                                <Setter Property="Rectangle.Opacity" Value="0.5" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Rectangle.Style>
                <Rectangle.Fill>
                    <VisualBrush Visual="{StaticResource appbar_close_white}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Image Source="{Binding PlayerClassImage}" DockPanel.Dock="Left" RenderOptions.BitmapScalingMode="Fant" Margin="2"/>
            <TextBlock Text="{Binding DeckName}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="SemiBold"  Foreground="White" />
        </DockPanel>
        <StackPanel Orientation="Horizontal" Margin="10" Height="48"
                    Visibility="{Binding ShowDetails, Converter={StaticResource BoolToVisibility}}">
            <ComboBox  SelectedItem="{Binding Format}" ItemsSource="{Binding Formats}" Width="100" Height="34"
                       IsEnabled="{Binding FormatSelectionEnabled}"/>
            <ComboBox SelectedItem="{Binding Mode}" ItemsSource="{Binding Modes}" Width="100" Height="34" Margin="5,0,0,0"/>
            <ComboBox SelectedItem="{Binding Result}" ItemsSource="{Binding Results}" Width="70" Height="34" Margin="5,0,0,0"/>
        </StackPanel>
    </StackPanel>
</UserControl>
