<controls:CustomDialog x:Class="Memenim.Framework.Dialogs.PasswordDialog"
                       d:DataContext="{d:DesignInstance local:PasswordDialog}"
                       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:Memenim.Framework.Dialogs"
                       xmlns:markupLocalization="clr-namespace:RIS.Localization.UI.WPF.Markup;assembly=RIS.Localization.UI.WPF"
                       xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
                       xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
                       xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
                       mc:Ignorable="d"
                       MinHeight="150" MinWidth="300"
                       Style="{StaticResource DefaultDialog}"
                       Title="{Binding Path=DialogTitle}"
                       KeyUp="Dialog_KeyUp">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>

        <emoji:TextBlock Grid.Row="0"
                         Style="{DynamicResource Paragraph}"
                         Foreground="{DynamicResource MahApps.Brushes.ThemeForeground}"
                         Text="{Binding Path=DialogMessage}"
                         TextWrapping="Wrap"
                         Margin="10"/>
        <StackPanel Grid.Row="1"
                    Orientation="Horizontal"
                    HorizontalAlignment="Center">
            <PasswordBox x:Name="PasswordTextBox"
                         Width="250" MinHeight="30"
                         Style="{DynamicResource MahApps.Styles.PasswordBox.Button.Revealed}"
                         Foreground="{DynamicResource MahApps.Brushes.ThemeForeground}"
                         controls:TextBoxHelper.SelectAllOnFocus="True"
                         Margin="10 10 5 10"
                         PasswordChanged="PasswordTextBox_OnPasswordChanged"/>
            <Button Width="25" Height="25"
                    Style="{StaticResource MahApps.Styles.Button.Square.Accent}"
                    Background="{DynamicResource MahApps.Brushes.Window.Background}"
                    Visibility="{Binding Path=CanGeneratePassword, Converter={StaticResource BooleanToVisibilityConverter}}"
                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                    BorderThickness="0"
                    Margin="0 0 10 0"
                    Click="GeneratePasswordButton_Click">
                <iconPacks:PackIconBootstrapIcons Width="15" Height="15"
                                                  Kind="Dice6Fill"
                                                  HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Button>
        </StackPanel>
        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right" VerticalAlignment="Bottom"
                    Margin="5">
            <Button x:Name="OkButton"
                    Style="{DynamicResource MahApps.Styles.Button.Dialogs.Accent}"
                    Content="{markupLocalization:LocalizedString OkTitle}"
                    Margin="0 0 10 0"
                    Click="Ok_Click"/>
            <Button x:Name="CancelButton"
                    Style="{DynamicResource MahApps.Styles.Button.Dialogs}"
                    Content="{markupLocalization:LocalizedString CancelTitle}"
                    Visibility="{Binding Path=IsCancellable, Converter={StaticResource BooleanToVisibilityConverter}}"
                    Margin="0 0 10 0"
                    Click="Cancel_Click"/>
        </StackPanel>
    </Grid>
</controls:CustomDialog>
