<UserControl x:Class="Hearthstone_Deck_Tracker.FlyoutControls.DeckExport.DeckExportView"
             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:Hearthstone_Deck_Tracker.FlyoutControls.DeckExport"
             xmlns:lex="http://wpflocalizeextension.codeplex.com"
             xmlns:controls="clr-namespace:Hearthstone_Deck_Tracker.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="300">
    <UserControl.DataContext>
        <local:DeckExportViewModel/>
     </UserControl.DataContext>
     <TabControl>
        <TabItem Header="{lex:Loc DeckExport_Header_DeckCode}">
            <DockPanel Margin="5">
                <TextBlock DockPanel.Dock="Top" Text="{lex:Loc DeckExport_Label_Instructions}" FontWeight="Bold"/>
                <TextBlock DockPanel.Dock="Top" Margin="5,0,0,0">
                    1. <Run Text="{lex:Loc DeckExport_Label_Step1}"/>
                    <LineBreak/>
                    2. <Run Text="{lex:Loc DeckExport_Label_Step2}"/>
                </TextBlock>
                <DockPanel DockPanel.Dock="Top">
                    <CheckBox Content="{lex:Loc DeckExport_Checkbox_IncludeVersion}" Margin="4" IsChecked="{Binding IncludeVersion}"/>
                </DockPanel>
                <UniformGrid DockPanel.Dock="Top" Rows="1" Margin="2,0">
                    <Button Command="{Binding CopyAllCommand}" Margin="0,5,2,5">
                        <StackPanel Orientation="Horizontal">
                            <Rectangle Width="12">
                                <Rectangle.Fill>
                                    <VisualBrush Visual="{StaticResource appbar_copy_white}"/>
                                </Rectangle.Fill>
                            </Rectangle>
                            <TextBlock Text="{Binding CopyAllButtonText}" Margin="4,0,0,0"/>
                        </StackPanel>
                    </Button>
                    <Button Command="{Binding CopyCodeCommand}" Margin="2,5,0,5">
                        <StackPanel Orientation="Horizontal">
                            <Rectangle Width="12">
                                <Rectangle.Fill>
                                    <VisualBrush Visual="{StaticResource appbar_copy_white}"/>
                                </Rectangle.Fill>
                            </Rectangle>
                            <TextBlock Text="{Binding CopyCodeButtonText}" Margin="4,0,0,0"/>
                        </StackPanel>
                    </Button>
                </UniformGrid>
                <TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" Text="{lex:Loc DeckExport_Text_CodeInfo}" FontStyle="Italic"/>
                <Border BorderThickness="1" BorderBrush="{DynamicResource AccentColorBrush}">
                    <ScrollViewer>
                        <TextBox Text="{Binding DeckStringWithComments, Mode=OneWay}" IsReadOnly="True" TextWrapping="Wrap" BorderThickness="0"/>
                    </ScrollViewer>
                </Border>
            </DockPanel>
        </TabItem>
        <TabItem Header="{Binding MissingCardsHeader}">
            <TabItem.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="FontWeight" Value="SemiBold"/>
                </Style>
                <Style x:Key="DustIconStyle" TargetType="Image">
                    <Setter Property="Width" Value="32"/>
                    <Setter Property="Height" Value="32"/>
                </Style>
            </TabItem.Resources>
            <Grid>
                <TextBlock Text="{lex:Loc DeckExport_MissingCards_Label_StartHearthstone}" Visibility="{Binding HasCollectionData, Converter={StaticResource InverseBoolToVisibility}}"
                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <Grid Visibility="{Binding HasCollectionData, Converter={StaticResource BoolToVisibility}}">
                    <TextBlock Text="{lex:Loc DeckExport_MissingCards_Label_AllOwned}" Visibility="{Binding HasMissingCards, Converter={StaticResource InverseBoolToVisibility}}"
                               HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <ScrollViewer VerticalScrollBarVisibility="Auto" Visibility="{Binding HasMissingCards, Converter={StaticResource BoolToVisibility}}">
                        <StackPanel Width="400" Margin="0,10">
                            <ItemsControl ItemsSource="{Binding MissingCards}" Margin="0,10">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                <TextBlock Text="{Binding CostString}" VerticalAlignment="Center" Margin="10,0,0,0" FontWeight="SemiBold"/>
                                                <Image Source="{StaticResource DustIcon}" Style="{StaticResource DustIconStyle}"/>
                                            </StackPanel>
                                            <controls:Card DataContext="{Binding Card}" HorizontalAlignment="Left"/>
                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                            <Separator></Separator>
                            <Grid>
                                <TextBlock Text="{lex:Loc DeckExport_MissingCards_Label_TotalCost}" FontWeight="SemiBold" VerticalAlignment="Center"/>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <TextBlock Text="{Binding TotalDustCost}" VerticalAlignment="Center" Margin="10,0,0,0"/>
                                    <Image Source="{StaticResource DustIcon}" Style="{StaticResource DustIconStyle}"/>
                                </StackPanel>
                            </Grid>
                            <TextBlock Text="{Binding RequiresKarazhanText}" Visibility="{Binding RequiresKarazhan, Converter={StaticResource BoolToVisibility}}" HorizontalAlignment="Right" />
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </Grid>
        </TabItem>
     </TabControl>
</UserControl>
