<UserControl x:Class="Hearthstone_Deck_Tracker.FlyoutControls.DeckScreenshot.DeckScreenshotView"
             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:deckScreenshot="clr-namespace:Hearthstone_Deck_Tracker.FlyoutControls.DeckScreenshot"
             xmlns:lex="http://wpflocalizeextension.codeplex.com"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="200">
    <UserControl.DataContext>
        <deckScreenshot:DeckScreenshotViewModel />
    </UserControl.DataContext>
    <DockPanel Margin="5,0">
        <CheckBox Content="{lex:Loc DeckScreenshot_Label_CardsOnly}" IsChecked="{Binding CardsOnly}" DockPanel.Dock="Top" />
        <DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" Visibility="{Binding TitleTextBoxVisibility}">
            <Label Content="{lex:Loc DeckScreenshot_Label_Title}" DockPanel.Dock="Left"/>
            <TextBox Text="{Binding DeckTitle, UpdateSourceTrigger=PropertyChanged, Delay=500}" DockPanel.Dock="Top" />
        </DockPanel>
        <Button Command="{Binding SaveCommand}" DockPanel.Dock="Top" Margin="0,5,0,0">
            <StackPanel Orientation="Horizontal">
                <Rectangle Width="12">
                    <Rectangle.Fill>
                        <VisualBrush Visual="{StaticResource appbar_save_white}"></VisualBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <TextBlock Text="{lex:LocTextUpper DeckScreenshot_Button_SaveToDisk}" Margin="4,0,0,0"/>
            </StackPanel>
        </Button>
        <DockPanel Margin="5,0" Visibility="{Binding SavedFileVisibility}" DockPanel.Dock="Top">
            <TextBlock DockPanel.Dock="Right" Margin="10,0,0,0">
                <Hyperlink NavigateUri="{Binding SavedFolderPath, TargetNullValue=''}" RequestNavigate="Hyperlink_OnRequestNavigate">
                    <Run Text="{lex:Loc DeckScreenshot_Label_OpenFolder}"></Run>
                </Hyperlink>
            </TextBlock>
            <TextBlock TextTrimming="CharacterEllipsis">
                <Hyperlink NavigateUri="{Binding SavedFilePath, TargetNullValue=''}" RequestNavigate="Hyperlink_OnRequestNavigate">
                    <Run Text="{Binding SavedFileShortName, Mode=OneWay}"></Run>
                </Hyperlink>
            </TextBlock>
        </DockPanel>
        <Button Command="{Binding UploadCommand}"
            IsEnabled="{Binding UploadButtonEnabled}" DockPanel.Dock="Top" Margin="0,5,0,0">
            <StackPanel Orientation="Horizontal">
                <Rectangle Width="12">
                    <Rectangle.Fill>
                        <VisualBrush Visual="{StaticResource appbar_upload_white}"/>
                    </Rectangle.Fill>
                </Rectangle>
                <TextBlock Text="{Binding UploadButtonText}" Margin="4,0,0,0"/>
            </StackPanel>
        </Button>
        <TextBlock Text="{lex:Loc DeckScreenshot_Text_UploadError}" 
            TextWrapping="Wrap" DockPanel.Dock="Top" Foreground="Red" Visibility="{Binding UploadErrorVisibility}"/>
        <TextBlock DockPanel.Dock="Top" Visibility="{Binding ImgurUrlVisibility}" Margin="5,0,0,0">
            <Hyperlink NavigateUri="{Binding ImgurUrl, TargetNullValue=''}" RequestNavigate="Hyperlink_OnRequestNavigate">
                <Run Text="{Binding ImgurUrl}"></Run>
            </Hyperlink>
        </TextBlock>
        <Button Command="{Binding CopyToClipboardCommand}" 
            DockPanel.Dock="Top" Margin="0,5,0,0">
            <StackPanel Orientation="Horizontal">
                <Rectangle Width="12">
                    <Rectangle.Fill>
                        <VisualBrush Visual="{StaticResource appbar_copy_white}"/>
                    </Rectangle.Fill>
                </Rectangle>
                <TextBlock Text="{Binding CopyToClipboardButtonText}" Margin="4,0,0,0"/>
            </StackPanel>
        </Button>
        <GroupBox Header="{lex:LocTextUpper DeckScreenshot_Preview_Header}" Margin="0,5">
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <Image DockPanel.Dock="Left" Width="219" Source="{Binding DeckImage}" RenderOptions.BitmapScalingMode="fant"/>
            </ScrollViewer>
        </GroupBox>
    </DockPanel>
</UserControl>
