<!--
/**** Git Credential Manager for Windows ****
 *
 * Copyright (c) Atlassian
 * All rights reserved.
 *
 * MIT License
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the """"Software""""), to deal
 * in the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
**/
-->
<sharedControls:DialogUserControl
    x:Class="Atlassian.Bitbucket.Authentication.Controls.OAuthControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Atlassian.Bitbucket.Authentication.Controls"
    xmlns:properties="clr-namespace:Atlassian.Bitbucket.Authentication.Properties"
    xmlns:sharedControls="clr-namespace:GitHub.Shared.Controls"
    xmlns:sharedHelpers="clr-namespace:GitHub.Shared.Helpers"
    mc:Ignorable="d"
    d:DesignWidth="414"
    d:DesignHeight="440"
    Style="{DynamicResource DialogUserControl}">
    <DockPanel Style="{DynamicResource DialogContainerDockPanel}">
        <DockPanel.Resources>
            <Style TargetType="{x:Type DockPanel}">
                <Setter Property="Margin" Value="0,0,0,0" />
                <Setter Property="LastChildFill" Value="True" />
            </Style>
            <Style x:Key="FormFieldStackPanel" TargetType="{x:Type StackPanel}">
                <Setter Property="Margin" Value="0,0,0,0" />
                <Setter Property="MaxWidth" Value="400" />
                <Setter Property="Height" Value="300"/>
                <Setter Property="Background" Value="{StaticResource PrimaryForeground}" />
            </Style>
            <Style x:Key="ExtraInformationStackPanel" TargetType="{x:Type StackPanel}">
                <Setter Property="Margin" Value="0,0,0,0" />
                <Setter Property="MaxWidth" Value="400" />
                <Setter Property="Background" Value="{StaticResource PrimaryBackground}" />
            </Style>
        </DockPanel.Resources>

        <StackPanel DockPanel.Dock="Bottom" Margin="0">

            <StackPanel  Style="{StaticResource ExtraInformationStackPanel}">
                <TextBlock

                    HorizontalAlignment="Center" Margin="0,0,0,0">
                <Hyperlink
                    Style="{StaticResource LightHyperlink}"
                    ToolTip="https://bitbucket.org/account/password/reset/"
                    Command="{Binding ForgotPasswordCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=ToolTip}">
                    <TextBlock Text="{x:Static properties:Resources.ForgotPasswordText}" />
                </Hyperlink>
            </TextBlock>
                <TextBlock TextWrapping="Wrap" HorizontalAlignment="Center"  Margin="0,11,0,0">
                    <Hyperlink
                        Style="{StaticResource LightHyperlink}"
                    ToolTip="https://bitbucket.org/account/signup/"
                    Command="{Binding SignUpCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=ToolTip}">
                    <TextBlock Text="{x:Static properties:Resources.SignUpLinkText}" />
                </Hyperlink>
                </TextBlock>
            </StackPanel>
        </StackPanel>
        <StackPanel DockPanel.Dock="Top">
            <Image Style="{StaticResource AtlassianLogo}"
                   HorizontalAlignment="Center" />
            <TextBlock Style="{StaticResource LightLogoStrapline}"
                       HorizontalAlignment="Center"
                       Text="{x:Static properties:Resources.OAuthAuthText}"/>
        </StackPanel>

        <Border Style="{StaticResource ForegroundStackPanelBorder}"
                Margin="0,10,0,0">
            <StackPanel Style="{StaticResource FormFieldStackPanel}">
                <TextBlock
                    Margin="0,44,0,11"
                    TextAlignment="Center"
                    HorizontalAlignment="Center"
                    TextWrapping="Wrap"
                    Style="{StaticResource BitbucketDescriptionTextBlock}"
                    VerticalAlignment="Center">
                    <Hyperlink
                        Style="{StaticResource BlueHyperlink}"
                        Command="{Binding LearnMoreCommand}"
                        CommandParameter="{Binding
                        RelativeSource={RelativeSource Self},
                        Path=ToolTip}"
                        ToolTip="https://confluence.atlassian.com/bitbucket/two-step-verification-777023203.html">
                        <TextBlock 
                            Text="{x:Static properties:Resources.LearnMoreLink}" />
                        
                    </Hyperlink>    
                </TextBlock>
                <Button
                            TabIndex="2"
                            IsDefault="True"
                            Command="{Binding OkCommand}"
                            IsEnabled="{Binding IsValid, Mode=OneWay}"
                            Content="{x:Static properties:Resources.AuthorizeLabel}"
                            Style="{StaticResource PrimaryButton}"
                            Width="280"
                            Margin="0,22,0,0"/>
            </StackPanel>
        </Border>
    </DockPanel>
</sharedControls:DialogUserControl>
