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

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

            <TextBlock
                Margin="0,16,0,0"
                Focusable="True"
                FontSize="12"
                TextWrapping="Wrap">
                <Run FontWeight="SemiBold" Text="{x:Static props:Resources.KeyboardControlsName}" />
                <Run Foreground="{DynamicResource SecondaryForegroundBrush}" Text="{x:Static props:Resources.KeyboardControlsDescriptionCanvas}" />
            </TextBlock>



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