<sharedControls:DialogUserControl
    x:Class="GitHub.UI.TwoFactorControl"
    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:controls="clr-namespace:GitHub.UI"
    xmlns:properties="clr-namespace:GitHub.Authentication.Properties"
    xmlns:sharedHelpers="clr-namespace:GitHub.Shared.Helpers"
    xmlns:sharedControls="clr-namespace:GitHub.Shared.Controls"
    mc:Ignorable="d"
    d:DesignWidth="414"
    d:DesignHeight="440"
    Style="{DynamicResource DialogUserControl}">

    <StackPanel
        Style="{DynamicResource DialogContainerStackPanel}"
        sharedHelpers:AccessKeysManagerScoping.IsEnabled="True">
        <controls:OcticonImage Icon="logo_github" Style="{StaticResource GitHubLogo}" />
        <WrapPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="0,0,0,12">
            <TextBlock
                Text="{x:Static properties:Resources.TwoFactorAuthText}"
                Padding="0"
                Margin="0,0,12,0"
                Style="{DynamicResource GitHubH1TextBlock}"
                Foreground="{DynamicResource GitHubTextBrush}" />
        </WrapPanel>

        <controls:HorizontalShadowDivider />

        <TextBlock
            Margin="30,0,30,16"
            TextAlignment="Center"
            HorizontalAlignment="Center"
            TextWrapping="Wrap"
            Style="{StaticResource GitHubDescriptionTextBlock}">
            <Run x:Name="description"
                 Text="{Binding Description, Mode=OneWay}" />
            <Hyperlink
                Command="{Binding LearnMoreCommand}"
                CommandParameter="{Binding
                    RelativeSource={RelativeSource Self},
                    Path=ToolTip}"
                ToolTip="https://help.github.com/articles/about-two-factor-authentication/">
                <TextBlock Text="{x:Static properties:Resources.LearnMoreLink}" />
            </Hyperlink>
        </TextBlock>
        <controls:TwoFactorInput
            x:Name="authenticationCode"
            Text="{Binding AuthenticationCode, Mode=OneWayToSource}"
            TabIndex="1" />
        <StackPanel
            Orientation="Horizontal"
            HorizontalAlignment="Center"
            Margin="0,38,0,60">
            <controls:OcticonCircleButton
                TabIndex="2"
                Icon="check"
                IsDefault="True"
                Command="{Binding OkCommand}"
                IsEnabled="{Binding IsValid, Mode=OneWay}"
                Content="{x:Static properties:Resources.VerifyText}" />
            <controls:OcticonCircleButton
                TabIndex="3"
                FontSize="12"
                Icon="x"
                IsCancel="True"
                Command="{Binding CancelCommand}"
                Margin="18,0,0,0"
                Content="{x:Static properties:Resources.CancelText}" />
        </StackPanel>
    </StackPanel>
</sharedControls:DialogUserControl>
