<Window
    BorderBrush="{StaticResource MainBorderColor}"
    BorderThickness="1"
    ExtendClientAreaTitleBarHeightHint="-1"
    Height="320"
    MinHeight="320"
    MinWidth="400"
    Title="Loading..."
    Width="400"
    WindowStartupLocation="CenterOwner"
    x:Class="PicView.Avalonia.Win32.Views.ImageInfoWindow"
    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"
        x:Name="ParentBorder">
        <DockPanel Background="Transparent">
            <DockPanel
                Background="{DynamicResource WindowBackgroundColor}"
                DockPanel.Dock="Top"
                Height="28"
                LastChildFill="True"
                x:Name="TopWindowBorder">

                <Image
                    DockPanel.Dock="Left"
                    Height="25"
                    Margin="7,1,7,1"
                    Source="{StaticResource LogoImage}"
                    Width="20" />


                <customControls:IconButton
                    Background="{DynamicResource MainButtonBackgroundColor}"
                    Classes="hover"
                    Click="Close"
                    ClickMode="Release"
                    Data="{StaticResource CloseGeometry}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    IconHeight="10"
                    IconWidth="10"
                    IsRepeatEnabled="False"
                    Width="29"
                    x:Name="CloseButton" />

                <customControls:IconButton
                    Background="{DynamicResource MainButtonBackgroundColor}"
                    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="29"
                    x:Name="MinimizeButton" />

                <buttons:StarOutlineButtons
                    Background="{DynamicResource SecondaryButtonBackgroundColor}"
                    DockPanel.Dock="Right"
                    IsEnabled="{CompiledBinding Exif.IsExifAvailable.Value,
                                                FallbackValue=False}"
                    x:Name="StarOutlineButtons" />

                <customControls:IconButton
                    Background="{DynamicResource SecondaryButtonBackgroundColor}"
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Classes="noBorderHover"
                    Command="{CompiledBinding Exif.SetExifRating0Command}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Icon="{StaticResource StarOffImage}"
                    IconHeight="17"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding Exif.IsExifAvailable.Value,
                                                FallbackValue=False}"
                    ToolTip.Tip="{CompiledBinding Translation.RemoveStarRating.Value,
                                                  Mode=OneWay}"
                    Width="35"
                    x:Name="RemoveRatingButton" />

                <Rectangle
                    DockPanel.Dock="Right"
                    Fill="{DynamicResource MainBorderColor}"
                    Height="28"
                    IsVisible="{CompiledBinding !InfoWindow.IsExtraButtonsEnabled.Value}"
                    Width="1" />

                <customControls:TextIconButton
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Classes="errorHover"
                    ClickMode="Release"
                    Command="{CompiledBinding Tools.RecycleFileCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    Data="{StaticResource RecycleGeometry}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="28"
                    IconHeight="17"
                    IconMargin="10,0,5,0"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                Converter={x:Static ObjectConverters.IsNotNull}}"
                    IsVisible="{CompiledBinding InfoWindow.IsExtraButtonsEnabled.Value}"
                    Text="{CompiledBinding Translation.DeleteFile.Value,
                                           Mode=OneWay}"
                    TextMargin="5,0,5,0"
                    TextMaxWidth="{CompiledBinding InfoWindow.ExtraTextBoxMaxWidth.Value}"
                    ToolTip.Tip="{CompiledBinding Translation.DeleteFile.Value,
                                                  Mode=OneWay}"
                    x:Name="RecycleButton" />

                <customControls:TextIconButton
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Classes="errorHover"
                    ClickMode="Release"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="28"
                    Icon="{StaticResource OffImage}"
                    IconHeight="17"
                    IconMargin="10,0,5,0"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding Exif.IsExifAvailable.Value,
                                                FallbackValue=False}"
                    IsVisible="{CompiledBinding InfoWindow.IsExtraButtonsEnabled.Value}"
                    Text="{CompiledBinding Translation.RemoveImageData.Value,
                                           Mode=OneWay}"
                    TextMargin="5,0,5,0"
                    TextMaxWidth="{CompiledBinding InfoWindow.TextBoxMaxWidth.Value}"
                    ToolTip.Tip="{CompiledBinding Translation.RemoveImageData.Value,
                                                  Mode=OneWay}"
                    x:Name="RemoveImageDataButton" />

                <customControls:TextIconButton
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Classes="noBorderHover"
                    Command="{Binding Tools.OptimizeImageCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="28"
                    Icon="{StaticResource PortalImage}"
                    IconHeight="17"
                    IconMargin="10,0,5,0"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding PicViewer.ShouldOptimizeImageBeEnabled.Value,
                                                Mode=OneWay}"
                    IsVisible="{CompiledBinding InfoWindow.IsExtraButtonsEnabled.Value}"
                    Text="{CompiledBinding Translation.OptimizeImage.Value,
                                           Mode=OneWay}"
                    TextMargin="5,0,5,0"
                    TextMaxWidth="{CompiledBinding InfoWindow.TextBoxMaxWidth.Value}"
                    ToolTip.Tip="{CompiledBinding Translation.OptimizeImage.Value,
                                                  Mode=OneWay}"
                    x:Name="OptimizeButton" />

                <customControls:TextIconButton
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Classes="noBorderHover"
                    Command="{CompiledBinding Tools.OpenWithCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="28"
                    Icon="{StaticResource OpenExternalImage}"
                    IconHeight="17"
                    IconMargin="10,0,5,0"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                Converter={x:Static ObjectConverters.IsNotNull}}"
                    IsVisible="{CompiledBinding InfoWindow.IsExtraButtonsEnabled.Value}"
                    Text="{CompiledBinding Translation.OpenWith.Value,
                                           Mode=OneWay}"
                    TextMargin="5,0,5,0"
                    TextMaxWidth="{CompiledBinding InfoWindow.TextBoxMaxWidth.Value}"
                    ToolTip.Tip="{CompiledBinding Translation.OpenWith.Value,
                                                  Mode=OneWay}"
                    x:Name="OpenWithButton" />

                <customControls:TextIconButton
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Classes="noBorderHover"
                    Command="{CompiledBinding Tools.DuplicateFileCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    Data="{StaticResource DuplicateGeometry}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="28"
                    IconHeight="17"
                    IconMargin="10,0,5,0"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                Converter={x:Static ObjectConverters.IsNotNull}}"
                    IsVisible="{CompiledBinding InfoWindow.IsExtraButtonsEnabled.Value}"
                    Text="{CompiledBinding Translation.DuplicateFile.Value,
                                           Mode=OneWay}"
                    TextMargin="5,0,5,0"
                    TextMaxWidth="{CompiledBinding InfoWindow.ExtraTextBoxMaxWidth.Value}"
                    ToolTip.Tip="{CompiledBinding Translation.DuplicateFile.Value,
                                                  Mode=OneWay}"
                    x:Name="DuplicateButton" />

                <customControls:TextIconButton
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="1,0,1,0"
                    Classes="noBorderHover"
                    Command="{CompiledBinding Tools.LocateOnDiskCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    Data="{StaticResource ShowInFolderGeometry}"
                    DockPanel.Dock="Right"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="28"
                    IconHeight="17"
                    IconMargin="10,0,5,0"
                    IconWidth="17"
                    IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                Converter={x:Static ObjectConverters.IsNotNull}}"
                    IsVisible="{CompiledBinding InfoWindow.IsExtraButtonsEnabled.Value}"
                    Text="{CompiledBinding Translation.DuplicateFile.Value,
                                           Mode=OneWay}"
                    TextMargin="5,0,5,0"
                    TextMaxWidth="{CompiledBinding InfoWindow.ExtraTextBoxMaxWidth.Value}"
                    ToolTip.Tip="{CompiledBinding Translation.ShowInFolder.Value,
                                                  Mode=OneWay}"
                    x:Name="LocateOnDiskButton" />

                <TextBlock
                    Classes="txt"
                    DockPanel.Dock="Left"
                    Foreground="{DynamicResource MainTextColor}"
                    Text="{CompiledBinding Translation.ImageInfo.Value,
                                           Mode=OneWay}"
                    TextAlignment="Center" />
            </DockPanel>
            <Rectangle
                DockPanel.Dock="Top"
                Fill="{DynamicResource MainBorderColor}"
                Height="1"
                Width="{Binding Path=Bounds.Width, ElementName=ParentBorder}"
                x:Name="BorderRectangle" />
            <main:ImageInfoView Background="{StaticResource NoisyTexture}" x:Name="ExifView" />
        </DockPanel>
    </Border>
</Window>