<Window
    CanResize="False"
    SizeToContent="WidthAndHeight"
    WindowStartupLocation="CenterOwner"
    x:Class="PicView.Avalonia.Win32.Views.SettingsWindow"
    x:DataType="viewModels:MainViewModel"
    xmlns="https://github.com/avaloniaui"
    xmlns:buttons="clr-namespace:PicView.Avalonia.Views.UC.Buttons;assembly=PicView.Avalonia"
    xmlns:customControls="clr-namespace:PicView.Avalonia.CustomControls;assembly=PicView.Avalonia"
    xmlns:main="clr-namespace:PicView.Avalonia.Views.Main;assembly=PicView.Avalonia"
    xmlns:viewModels="clr-namespace:PicView.Avalonia.ViewModels;assembly=PicView.Avalonia"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Border
        BorderBrush="{DynamicResource WindowBorderColor}"
        BorderThickness="1"
        PointerPressed="MoveWindow"
        PointerReleased="UpdateWindowPosition"
        x:Name="ParentBorder">
        <StackPanel>
            <Border
                BorderBrush="{DynamicResource MainBorderColor}"
                BorderThickness="0,0,0,1"
                Height="{StaticResource TopBorderHeight}"
                VerticalAlignment="Top">
                <DockPanel LastChildFill="True" VerticalAlignment="Top">
                    <Border
                        Background="{DynamicResource WindowButtonBackgroundColor}"
                        BorderBrush="{DynamicResource MainBorderColor}"
                        BorderThickness="0,0,1,0"
                        DockPanel.Dock="Left"
                        x:Name="LogoBorder">
                        <Image
                            Height="25"
                            Margin="10,1,10,1"
                            Source="{StaticResource LogoImage}"
                            Width="20" />
                    </Border>

                    <Border
                        Background="{DynamicResource WindowSecondaryBackgroundColor}"
                        DockPanel.Dock="Left"
                        x:Name="GoBackBorder">
                        <customControls:IconButton
                            Background="{DynamicResource WindowSecondaryBackgroundColor}"
                            Classes="noBorderHover"
                            Command="{CompiledBinding SettingsViewModel.GoBackCommand}"
                            Data="{StaticResource ArrowLeftGeometry}"
                            Foreground="{DynamicResource MainTextColor}"
                            IconHeight="12"
                            IconWidth="12"
                            Padding="8,0"
                            x:Name="GoBackButton" />
                    </Border>

                    <Border
                        Background="{DynamicResource WindowSecondaryBackgroundColor}"
                        BorderBrush="{DynamicResource MainBorderColor}"
                        BorderThickness="0,0,1,0"
                        DockPanel.Dock="Left"
                        x:Name="GoForwardBorder">
                        <customControls:IconButton
                            Background="{DynamicResource WindowSecondaryBackgroundColor}"
                            Classes="noBorderHover"
                            Command="{CompiledBinding SettingsViewModel.GoForwardCommand}"
                            Data="{StaticResource ArrowRightGeometry}"
                            Foreground="{DynamicResource MainTextColor}"
                            IconHeight="12"
                            IconWidth="12"
                            Padding="8,0"
                            x:Name="GoForwardButton" />
                    </Border>

                    <customControls:IconButton
                        Background="{DynamicResource WindowButtonBackgroundColor}"
                        Classes="hover"
                        Click="Close"
                        ClickMode="Release"
                        Data="{StaticResource CloseGeometry}"
                        DockPanel.Dock="Right"
                        Foreground="{DynamicResource MainTextColor}"
                        IconHeight="10"
                        IconWidth="10"
                        IsRepeatEnabled="False"
                        ToolTip.Tip="{CompiledBinding Translation.Close.Value,
                                                      Mode=OneWay}"
                        Width="30"
                        x:Name="CloseButton" />

                    <customControls:IconButton
                        Background="{DynamicResource WindowButtonBackgroundColor}"
                        BorderBrush="{DynamicResource MainBorderColor}"
                        BorderThickness="1,0,1,0"
                        Classes="hover"
                        Click="Minimize"
                        ClickMode="Release"
                        Data="{StaticResource MinimizeGeometry}"
                        DockPanel.Dock="Right"
                        Foreground="{DynamicResource MainTextColor}"
                        IconHeight="12"
                        IconWidth="12"
                        IsRepeatEnabled="False"
                        Width="30"
                        x:Name="MinimizeButton" />

                    <buttons:SettingsMenuButton x:Name="SettingsButton" />

                    <TextBlock
                        Background="{StaticResource WindowSecondaryBackgroundColor}"
                        Classes="txt"
                        Foreground="{DynamicResource MainTextColor}"
                        LineHeight="{StaticResource TopBorderHeight}"
                        Padding="30,0,0,0"
                        Text="{CompiledBinding Translation.Settings.Value,
                                               Mode=OneWay}"
                        TextAlignment="Center"
                        x:Name="TitleText" />
                </DockPanel>
            </Border>

            <main:SettingsView Background="{DynamicResource NoisyTexture}" x:Name="SettingsView" />

        </StackPanel>
    </Border>
</Window>