<Window
    BorderBrush="{DynamicResource SecondaryBackgroundColor}"
    BorderThickness="1"
    CanResize="{Binding MainWindow.CanResize.Value}"
    ExtendClientAreaChromeHints="SystemChrome"
    ExtendClientAreaTitleBarHeightHint="-1"
    MinHeight="{CompiledBinding MainWindow.WindowMinHeight.Value}"
    MinWidth="{CompiledBinding MainWindow.WindowMinWidth.Value}"
    SizeChanged="Control_OnSizeChanged"
    SizeToContent="{CompiledBinding MainWindow.SizeToContent.Value}"
    Title="{CompiledBinding PicViewer.WindowTitle.Value}"
    x:Class="PicView.Avalonia.MacOS.Views.MacMainWindow"
    x:DataType="viewModels:MainViewModel"
    xmlns="https://github.com/avaloniaui"
    xmlns:converters="clr-namespace:PicView.Avalonia.Converters;assembly=PicView.Avalonia"
    xmlns:main="clr-namespace:PicView.Avalonia.Views.Main;assembly=PicView.Avalonia"
    xmlns:uc="clr-namespace:PicView.Avalonia.Views.UC;assembly=PicView.Avalonia"
    xmlns:viewModels="clr-namespace:PicView.Avalonia.ViewModels;assembly=PicView.Avalonia"
    xmlns:views1="clr-namespace:PicView.Avalonia.MacOS.Views"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Window.Resources>
        <converters:SortFilesByToBoolConverter x:Key="EnumToBoolConverter" />
    </Window.Resources>
    <NativeMenu.Menu>
        <NativeMenu>

            <!--  File  -->
            <NativeMenuItem Header="{CompiledBinding Translation.File.Value}">
                <NativeMenu>

                    <!--  Open  -->
                    <NativeMenuItem Command="{CompiledBinding Tools.OpenFileCommand}" Header="{CompiledBinding Translation.Open.Value, Mode=OneWay}" />

                    <!--  Open with  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.OpenWithCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.OpenWith.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                    <!--  Save  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.SaveFileCommand}"
                        Header="{CompiledBinding Translation.Save.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Save as  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.SaveFileAsCommand}"
                        Header="{CompiledBinding Translation.SaveAs.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Print  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.PrintCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.Print.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Locate on disk  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.LocateOnDiskCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.ShowInFolder.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Delete file  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.DeleteFilePermanentlyCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.DeleteFile.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Reload  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.ReloadCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.Reload.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  New window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.NewWindow}" Header="{CompiledBinding Translation.NewWindow.Value, Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Rename  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.RenameCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.RenameFile.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                </NativeMenu>
            </NativeMenuItem>

            <!--  Edit  -->
            <NativeMenuItem Header="{CompiledBinding Translation.Edit.Value, Mode=OneWay}">
                <NativeMenu>
                    <!--  Copy image  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.CopyImageCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.CopyImage.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                    <!--  Copy file path  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.CopyFilePathCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.FileCopyPath.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                </NativeMenu>

                <NativeMenuItemSeparator />

                <!--  Duplicate file  -->
                <NativeMenuItem
                    Command="{CompiledBinding Tools.DuplicateFileCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    Header="{CompiledBinding Translation.DuplicateFile.Value,
                                             Mode=OneWay}"
                    IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                Converter={x:Static ObjectConverters.IsNotNull}}" />

                <NativeMenuItemSeparator />

                <!--  Paste  -->
                <NativeMenuItem Command="{CompiledBinding Tools.PasteCommand}" Header="{CompiledBinding Translation.Paste.Value, Mode=OneWay}" />

                <NativeMenuItemSeparator />

                <!--  Delete file  -->
                <NativeMenuItem
                    Command="{CompiledBinding Tools.RecycleFileCommand}"
                    CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                       FallbackValue=''}"
                    Header="{CompiledBinding Translation.DeleteFile.Value,
                                             Mode=OneWay}"
                    IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                Converter={x:Static ObjectConverters.IsNotNull}}" />
            </NativeMenuItem>

            <!--  View  -->
            <NativeMenuItem Header="{CompiledBinding Translation.View.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  Toggle UI  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ToggleUICommand}"
                        Header="{CompiledBinding Translation.ShowUI.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding MainWindow.IsUIShown.Value,
                                                    Mode=OneWay}"
                        ToggleType="CheckBox" />
                    <!--  Change background  -->
                    <NativeMenuItem Command="{CompiledBinding Tools.ChangeBackgroundCommand}" Header="{CompiledBinding Translation.ChangeBackground.Value, Mode=OneWay}" />

                    <!--  Toggle side-by-side  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ShowSideBySideCommand}"
                        Header="{CompiledBinding Translation.SideBySide.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding PicViewer.IsShowingSideBySide.Value}"
                        ToggleType="CheckBox" />


                    <!--  Toggle bottom bar  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ToggleBottomNavBarCommand}"
                        Header="{CompiledBinding Translation.ShowBottomToolbar.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding MainWindow.IsBottomToolbarShown.Value}"
                        ToggleType="CheckBox" />

                    <NativeMenuItemSeparator />

                    <!--  Toggle bottom gallery  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Gallery.ToggleBottomGalleryCommand}"
                        Header="{CompiledBinding Translation.ShowBottomGallery.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Gallery.IsBottomGalleryShown.Value}"
                        ToggleType="CheckBox" />

                    <!--  Toggle gallery  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Gallery.ToggleGalleryCommand}"
                        Header="{CompiledBinding Translation.ShowImageGallery.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Gallery.IsGalleryExpanded.Value}"
                        ToggleType="CheckBox" />

                    <NativeMenuItemSeparator />


                    <!--  Fullscreen  -->
                    <NativeMenuItem Command="{CompiledBinding MainWindow.ToggleFullscreenCommand}" Header="{CompiledBinding Translation.Fullscreen.Value, Mode=OneWay}" />

                    <!--  Maximize  -->
                    <NativeMenuItem
                        Command="{CompiledBinding MainWindow.MaximizeCommand}"
                        Header="{CompiledBinding Translation.Maximize.Value,
                                                 Mode=OneWay}"
                        IsVisible="{CompiledBinding MainWindow.ShouldMaximizeBeShown.Value,
                                                    Mode=OneWay}" />

                    <!--  Restore  -->
                    <NativeMenuItem
                        Command="{CompiledBinding MainWindow.RestoreCommand}"
                        Header="{CompiledBinding Translation.RestoreDown.Value,
                                                 Mode=OneWay}"
                        IsVisible="{CompiledBinding MainWindow.ShouldRestore.Value,
                                                    Mode=OneWay}" />

                </NativeMenu>
            </NativeMenuItem>

            <!--  Image  -->
            <NativeMenuItem Header="{CompiledBinding Translation.Image.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  Rotate left  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.RotateLeftCommand}"
                        Header="{CompiledBinding Translation.RotateLeft.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                    <!--  Rotate right  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.RotateRightCommand}"
                        Header="{CompiledBinding Translation.RotateRight.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                    <!--  Flip  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.FlipCommand}"
                        Header="{CompiledBinding Translation.Flip.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Crop  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.CropCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.Crop.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Wallpaper  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.SetAsWallpaperCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.SetAsWallpaper.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ImageSource.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}"
                        IsVisible="{CompiledBinding GlobalSettings.ShowSetAsWallpaper.Value}" />

                    <NativeMenuItemSeparator />

                    <!--  Show image info window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowImageInfoWindow}" Header="{CompiledBinding Translation.ImageInfo.Value, Mode=OneWay}" />

                    <!--  File properties  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.FilePropertiesCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.FileProperties.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Show single image resize window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowSingleImageResizeWindow}" Header="{CompiledBinding Translation.ResizeImage.Value, Mode=OneWay}" />

                    <!--  Show batch resize window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowBatchResizeWindow}" Header="{CompiledBinding Translation.BatchResize.Value, Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Optimize image  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.OptimizeImageCommand}"
                        CommandParameter="{CompiledBinding PicViewer.FileInfo.Value.FullName,
                                                           FallbackValue=''}"
                        Header="{CompiledBinding Translation.OptimizeImage.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.ShouldOptimizeImageBeEnabled.Value,
                                                    Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Show effects window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowEffectsWindow}" Header="{CompiledBinding Translation.Effects.Value, Mode=OneWay}" />
                </NativeMenu>
            </NativeMenuItem>

            <!--  Navigation  -->
            <NativeMenuItem Header="{CompiledBinding Translation.Navigation.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  Slideshow  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.StartSlideShowTask}"
                        CommandParameter="-1"
                        Header="{CompiledBinding Translation.Slideshow.Value,
                                                 Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  First image  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.FirstCommand}"
                        Header="{CompiledBinding Translation.FirstImage.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />
                    <!--  Last image  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.LastCommand}"
                        Header="{CompiledBinding Translation.LastImage.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Skip 10  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.Skip10Command}"
                        Header="{CompiledBinding Translation.AdvanceBy10Images.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Skip 100  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.Skip100Command}"
                        Header="{CompiledBinding Translation.AdvanceBy100Images.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Go back 10  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.Prev10Command}"
                        Header="{CompiledBinding Translation.GoBackBy10Images.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Go back 100  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.Prev100Command}"
                        Header="{CompiledBinding Translation.GoBackBy100Images.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <NativeMenuItemSeparator />

                    <!--  Next folder  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.NextFolderCommand}"
                        Header="{CompiledBinding Translation.NextFolder.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                    <!--  Previous folder  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Navigation.PreviousFolderCommand}"
                        Header="{CompiledBinding Translation.PrevFolder.Value,
                                                 Mode=OneWay}"
                        IsEnabled="{CompiledBinding PicViewer.FileInfo.Value,
                                                    Converter={x:Static ObjectConverters.IsNotNull}}" />

                </NativeMenu>
            </NativeMenuItem>

            <!--  Sort files  -->
            <NativeMenuItem Header="{CompiledBinding Translation.SortFilesBy.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  Sort by file name  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Sorting.SortFilesByNameCommand}"
                        Header="{CompiledBinding Translation.FileName.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Sorting.SortOrder.Value,
                                                    Converter={StaticResource EnumToBoolConverter},
                                                    ConverterParameter=Name}"
                        ToggleType="Radio" />

                    <!--  Sort by file size  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Sorting.SortFilesBySizeCommand}"
                        Header="{CompiledBinding Translation.FileSize.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Sorting.SortOrder.Value,
                                                    Converter={StaticResource EnumToBoolConverter},
                                                    ConverterParameter=FileSize}"
                        ToggleType="Radio" />

                    <!--  Sort by file extension  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Sorting.SortFilesByExtensionCommand}"
                        Header="{CompiledBinding Translation.FileExtension.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Sorting.SortOrder.Value,
                                                    Converter={StaticResource EnumToBoolConverter},
                                                    ConverterParameter=FileExtension}"
                        ToggleType="Radio" />

                    <!--  Sort by file creation  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Sorting.SortFilesByCreationTimeCommand}"
                        Header="{CompiledBinding Translation.Created.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Sorting.SortOrder.Value,
                                                    Converter={StaticResource EnumToBoolConverter},
                                                    ConverterParameter=Created}"
                        ToggleType="Radio" />

                    <!--  Sort by last accessed  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Sorting.SortFilesByLastAccessTimeCommand}"
                        Header="{CompiledBinding Translation.LastAccessTime.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Sorting.SortOrder.Value,
                                                    Converter={StaticResource EnumToBoolConverter},
                                                    ConverterParameter=LastAccessTime}"
                        ToggleType="Radio" />

                    <!--  Sort files randomly  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Sorting.SortFilesRandomlyCommand}"
                        Header="{CompiledBinding Translation.Random.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding Sorting.SortOrder.Value,
                                                    Converter={StaticResource EnumToBoolConverter},
                                                    ConverterParameter=Random}"
                        ToggleType="Radio" />
                </NativeMenu>
            </NativeMenuItem>

            <!--  Settings  -->
            <NativeMenuItem Header="{CompiledBinding Translation.Settings.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  Change background  -->
                    <NativeMenuItem Command="{CompiledBinding Tools.ChangeBackgroundCommand}" Header="{CompiledBinding Translation.ChangeBackground.Value, Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Toggle looping  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ToggleLoopingCommand}"
                        Header="{CompiledBinding Translation.IsLooping.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding GlobalSettings.IsLooping.Value}"
                        ToggleType="CheckBox" />

                    <!--  Toggle stretch  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.StretchCommand}"
                        Header="{CompiledBinding Translation.Stretch.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding GlobalSettings.IsStretched.Value}"
                        ToggleType="CheckBox" />

                    <!--  Toggle scroll  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ToggleScrollCommand}"
                        Header="{CompiledBinding Translation.ToggleScroll.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding GlobalSettings.IsScrollingEnabled.Value}"
                        ToggleType="CheckBox" />

                    <NativeMenuItemSeparator />

                    <!--  Change topmost  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ChangeTopMostCommand}"
                        Header="{CompiledBinding Translation.StayTopMost.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding GlobalSettings.IsTopMost.Value}"
                        ToggleType="CheckBox" />

                    <NativeMenuItemSeparator />

                    <!--  Toggle subdirectories  -->
                    <NativeMenuItem
                        Command="{CompiledBinding Tools.ToggleSubdirectoriesCommand}"
                        Header="{CompiledBinding Translation.SearchSubdirectory.Value,
                                                 Mode=OneWay}"
                        IsChecked="{CompiledBinding GlobalSettings.IsIncludingSubdirectories.Value}"
                        ToggleType="CheckBox" />

                    <NativeMenuItemSeparator />

                    <!--  Show keybindings  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowKeybindingsWindow}" Header="{CompiledBinding Translation.ApplicationShortcuts.Value, Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Show about window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowAboutWindow}" Header="{CompiledBinding Translation.About.Value, Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Show settings window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowSettingsWindow}" Header="{CompiledBinding Translation.ShowAllSettingsWindow.Value, Mode=OneWay}" />
                </NativeMenu>
            </NativeMenuItem>

            <!--  Window  -->
            <NativeMenuItem Header="{CompiledBinding Translation.Window.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  New window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.NewWindow}" Header="{CompiledBinding Translation.NewWindow.Value, Mode=OneWay, Mode=OneWay}" />

                    <NativeMenuItemSeparator />

                    <!--  Maximize  -->
                    <NativeMenuItem Command="{CompiledBinding MainWindow.MaximizeCommand}" Header="{CompiledBinding Translation.Maximize.Value, Mode=OneWay}" />

                    <!--  Toggle fullscreen  -->
                    <NativeMenuItem Command="{CompiledBinding MainWindow.ToggleFullscreenCommand}" Header="{CompiledBinding Translation.Fullscreen.Value, Mode=OneWay}" />
                </NativeMenu>
            </NativeMenuItem>

            <!--  Help  -->
            <NativeMenuItem Header="{CompiledBinding Translation.Help.Value, Mode=OneWay}">
                <NativeMenu>

                    <!--  Show about window  -->
                    <NativeMenuItem Command="{CompiledBinding Window.ShowAboutWindow}" Header="{CompiledBinding Translation.About.Value, Mode=OneWay}" />

                    <!--  Check for updates  -->
                    <NativeMenuItem Command="{CompiledBinding Tools.CheckForUpdatesCommand}" Header="{CompiledBinding Translation.CheckForUpdates.Value, Mode=OneWay}" />
                </NativeMenu>
            </NativeMenuItem>

        </NativeMenu>
    </NativeMenu.Menu>

    <DockPanel LastChildFill="True">
        <views1:MacOSTitlebar DockPanel.Dock="Top" x:Name="Titlebar" />
        <uc:BottomBar DockPanel.Dock="Bottom" x:Name="BottomBar" />
        <main:MainView Background="Transparent" x:Name="MainView" />
    </DockPanel>
</Window>