<ContentDialog
    x:Class="Wino.Dialogs.SignatureEditorDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:accounts="using:Wino.Core.Domain.Models.Accounts"
    xmlns:controls="using:Wino.Controls"
    xmlns:controls1="using:CommunityToolkit.WinUI.Controls"
    xmlns:controls2="using:Wino.Mail.Controls"
    xmlns:coreControls="using:Wino.Mail.WinUI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:domain="using:Wino.Core.Domain"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    Title="{x:Bind domain:Translator.SignatureEditorDialog_Title}"
    HorizontalContentAlignment="Stretch"
    Closed="DialogClosed"
    DefaultButton="Primary"
    IsPrimaryButtonEnabled="False"
    Opened="SignatureDialogOpened"
    PrimaryButtonClick="SaveClicked"
    PrimaryButtonText="{x:Bind domain:Translator.Buttons_Save}"
    SecondaryButtonClick="CancelClicked"
    SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
    Style="{StaticResource WinoDialogStyle}"
    mc:Ignorable="d">

    <ContentDialog.Resources>
        <x:Double x:Key="ContentDialogMaxWidth">1200</x:Double>
    </ContentDialog.Resources>

    <Grid Margin="0,8,0,0" RowSpacing="24">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" MaxHeight="400" />
        </Grid.RowDefinitions>

        <TextBox
            x:Name="SignatureNameTextBox"
            MinWidth="300"
            MaxWidth="500"
            HorizontalAlignment="Left"
            PlaceholderText="{x:Bind domain:Translator.SignatureEditorDialog_SignatureName_Placeholder}"
            TextChanged="SignatureNameTextBoxTextChanged" />

        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="300" />
            </Grid.RowDefinitions>
            <controls2:EditorTabbedCommandBarControl CommandTarget="{x:Bind WebViewEditor}" />
            <Border
                Grid.Row="1"
                Margin="0,8,0,0"
                BorderBrush="{StaticResource CardStrokeColorDefaultBrush}"
                BorderThickness="1"
                CornerRadius="6">
                <controls2:WebViewEditorControl x:Name="WebViewEditor" />
            </Border>
        </Grid>
    </Grid>
</ContentDialog>

