<local:EditorWindow x:Class="FancyZonesEditor.CanvasEditorWindow"
                    AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:local="clr-namespace:FancyZonesEditor"
                    xmlns:props="clr-namespace:FancyZonesEditor.Properties"
                    mc:Ignorable="d"
                    Title=""
                    Height="196"
                    MinWidth="360"
                    BorderThickness="0"
                    xmlns:ui="http://schemas.modernwpf.com/2019"
                    ui:WindowHelper.UseModernWindowStyle="True"
                    ui:TitleBar.IsIconVisible="False"
                    SizeToContent="Width"
                    Background="{DynamicResource PrimaryBackgroundBrush}"
                    ResizeMode="NoResize"
                    WindowStartupLocation="CenterOwner"
                    ContentRendered="EditorWindow_ContentRendered"
                    Closed="OnClosed">
    <Grid Height="160">
        <Grid Height="36"
              Background="{DynamicResource SecondaryBackgroundBrush}"
              Margin="0,-36,0,0"
              VerticalAlignment="Top"
              HorizontalAlignment="Stretch">
            <Border Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
                    Width="30"
                    Height="3"
                    CornerRadius="1.5"
                    VerticalAlignment="Center"
                    Margin="0,4,0,0" />
        </Grid>
        <StackPanel Margin="16" VerticalAlignment="Bottom"
                    FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">

            <local:ClickAutomationEventButton x:Name="newZoneButton"
                    HorizontalAlignment="Stretch"
                    Height="64"
                    Width="64"
                    ui:ControlHelper.CornerRadius="64"
                    Margin="0,8,0,0"
                    Style="{StaticResource AccentButtonStyle}"
                    FontFamily="Segoe MDL2 Assets"
                    Content="&#xE109;"
                    FontSize="24"
                    TabIndex="0"
                    ToolTip="{x:Static props:Resources.Add_zone}"
                    DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
                    IsEnabled="{Binding IsZoneAddingAllowed}"
                    Click="OnAddZone"
                    OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" />

            <Grid Margin="0,24,0,-4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="8" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Button Content="{x:Static props:Resources.Cancel}"
                        Style="{StaticResource DefaultButtonStyle}"
                        HorizontalAlignment="Stretch"
                        Grid.Column="2"
                        TabIndex="2"
                        Click="OnCancel" />
                <Button Content="{x:Static props:Resources.Save_Apply}"
                        Style="{StaticResource AccentButtonStyle}"
                        TabIndex="1"
                        HorizontalAlignment="Stretch"
                        Click="OnSaveApplyTemplate" />
            </Grid>
        </StackPanel>
    </Grid>
</local:EditorWindow>