<local:GenericGistCreationView x:Class="GitHub.VisualStudio.Views.Dialog.GistCreationView"
                               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:GitHub.VisualStudio.Views.Dialog"
                               xmlns:ghfvs="https://github.com/github/VisualStudio"
                               xmlns:controls="clr-namespace:GitHub.VisualStudio.UI.Controls"
                               mc:Ignorable="d"
                               d:DesignWidth="414"
                               d:DesignHeight="440"
                               xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
                               Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
                               Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
                               AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.GistCreationControlCustom}">
    <Control.Resources>
        <ResourceDictionary Source="DialogStyles.xaml" />
    </Control.Resources>

    <DockPanel Style="{DynamicResource DialogContainerDockPanel}">
        <ghfvs:OcticonImage Icon="logo_github" Style="{DynamicResource GitHubLogo}" Margin="0,10,0,-10" Panel.ZIndex="100" DockPanel.Dock="Top" />

        <Button
            DockPanel.Dock="Bottom"
            IsDefault="True"
            Margin="0"
            x:Name="createGistButton"
            HorizontalAlignment="Center"
            Content="{x:Static ghfvs:Resources.CreateLink}">
        </Button>

        <StackPanel>
            <controls:HorizontalShadowDivider />
            <Grid
                FocusManager.IsFocusScope="True"
                Margin="30,-10,30,10"
                FocusVisualStyle="{x:Null}">

                <Grid.Resources>
                    <Style TargetType="{x:Type Label}" BasedOn="{StaticResource {x:Type Label}}">
                        <Setter Property="VerticalAlignment" Value="Center" />
                        <Setter Property="HorizontalAlignment" Value="Right" />
                        <Setter Property="Margin" Value="0,0,10,0" />
                        <Setter Property="Padding" Value="0" />
                    </Style>

                    <Style TargetType="{x:Type ghfvs:PromptTextBox}" BasedOn="{StaticResource {x:Type ghfvs:PromptTextBox}}">
                        <Setter Property="Margin" Value="0,5" />
                    </Style>

                    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
                        <Setter Property="Padding" Value="0" />
                        <Setter Property="VerticalContentAlignment" Value="Center" />
                    </Style>
                </Grid.Resources>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="35" />
                    <RowDefinition Height="35" />
                    <RowDefinition Height="35" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Label Grid.Column="0" Grid.Row="0" Target="{Binding ElementName=nameTextBox}" Content="{x:Static ghfvs:Resources.fileNameText}"/>
                <ghfvs:PromptTextBox x:Name="fileNameTextBox" Grid.Column="1" Grid.Row="0" AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.GistFileNameTextBox}" />

                <Label Grid.Column="0" Grid.Row="1" Target="{Binding ElementName=descriptionTextBox}" Content="{x:Static ghfvs:Resources.Description}"/>
                <ghfvs:PromptTextBox x:Name="descriptionTextBox" Grid.Column="1" Grid.Row="1" SpellCheck.IsEnabled="True" AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.GistDescriptionTextBlock}"/>

                <StackPanel x:Name="accountStackPanel" Grid.Column="1" Grid.Row="2" Orientation="Horizontal">
                    <Image
                        Source="{Binding Avatar}"
                        Width="16"
                        Height="16"
                        RenderOptions.BitmapScalingMode="HighQuality"
                        Margin="0,0,8,0" />
                    <TextBlock Text="{Binding Login}" VerticalAlignment="Center"/>
                </StackPanel>

                <CheckBox 
                    x:Name="makePrivate"
                    Grid.Column="1"
                    Grid.Row="3"
                    Content="{x:Static ghfvs:Resources.makePrivateGist}"
                    AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PrivateGistCheckBox}" />

                <ghfvs:ErrorMessageDisplay
                    x:Name="errorMessage"
                    Grid.ColumnSpan="2"
                    Grid.Row="4"
                    Margin="0,10"
                    Message="{x:Static ghfvs:Resources.gistCreationFailedMessage}">
                    <TextBlock x:Name="errorMessageText" TextWrapping="Wrap" Text="{x:Static ghfvs:Resources.gistCreationFailedMessage}"/>
                </ghfvs:ErrorMessageDisplay>
            </Grid>
        </StackPanel>
    </DockPanel>
</local:GenericGistCreationView>