<adonisControls:AdonisWindow x:Class="FModel.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:FModel"
        xmlns:viewModels="clr-namespace:FModel.ViewModels"
        xmlns:controls="clr-namespace:FModel.Views.Resources.Controls"
        xmlns:inputs="clr-namespace:FModel.Views.Resources.Controls.Inputs"
        xmlns:converters="clr-namespace:FModel.Views.Resources.Converters"
        xmlns:settings="clr-namespace:FModel.Settings"
        xmlns:services="clr-namespace:FModel.Services"
        xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
        xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI"
        xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI"
        WindowStartupLocation="CenterScreen" Closing="OnClosing" Loaded="OnLoaded" PreviewKeyDown="OnWindowKeyDown"
        Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenHeight}, Converter={converters:RatioConverter}, ConverterParameter='0.95'}"
        Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.90'}"
        AllowDrop="True">
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo ProgressValue="1.0">
            <TaskbarItemInfo.ProgressState>
                <MultiBinding Converter="{converters:StatusToTaskbarStateConverter}">
                    <Binding Path="Status.Kind" />
                    <Binding Path="IsActive" RelativeSource="{RelativeSource AncestorType=Window}" />
                </MultiBinding>
            </TaskbarItemInfo.ProgressState>
        </TaskbarItemInfo>
    </Window.TaskbarItemInfo>
    <Window.Resources>
        <Canvas x:Key="ExportSessionIcon" x:Shared="False" Width="24" Height="24">
            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"
                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                  Data="M12 21l-8 -4.5v-9l8 -4.5l8 4.5v4.5" />
            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"
                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                  Data="M12 12l8 -4.5" />
            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"
                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                  Data="M12 12v9" />
            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"
                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                  Data="M12 12l-8 -4.5" />
            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"
                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                  Data="M15 18h7" />
            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"
                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                  Data="M19 15l3 3l-3 3" />
        </Canvas>
    </Window.Resources>
    <adonisControls:AdonisWindow.Style>
        <Style TargetType="adonisControls:AdonisWindow" BasedOn="{StaticResource {x:Type adonisControls:AdonisWindow}}" >
            <Setter Property="Title" Value="{Binding DataContext.InitialWindowTitle, RelativeSource={RelativeSource Self}}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding DataContext.TitleExtra, RelativeSource={RelativeSource Self}, Converter={x:Static converters:IsNullToBoolReversedConverter.Instance}}" Value="True">
                    <Setter Property="Title">
                        <Setter.Value>
                            <MultiBinding StringFormat="{}{0} - {1} {2}">
                                <Binding Path="DataContext.InitialWindowTitle" RelativeSource="{RelativeSource Self}" />
                                <Binding Path="DataContext.GameDisplayName" RelativeSource="{RelativeSource Self}" />
                                <Binding Path="DataContext.TitleExtra" RelativeSource="{RelativeSource Self}" />
                            </MultiBinding>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </adonisControls:AdonisWindow.Style>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="8" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Menu Grid.Column="0">
                <MenuItem Header="Directory">
                    <MenuItem Header="Selector" Command="{Binding MenuCommand}" CommandParameter="Directory_Selector">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource DirectoryIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="AES" Command="{Binding MenuCommand}" CommandParameter="Directory_AES" IsEnabled="{Binding Status.IsReady}">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource KeyIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Backup" Command="{Binding MenuCommand}" CommandParameter="Directory_Backup" IsEnabled="{Binding Status.IsReady}">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource BackupIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Archives Info" Command="{Binding MenuCommand}" CommandParameter="Directory_ArchivesInfo" IsEnabled="{Binding Status.IsReady}">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource InfoIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <MenuItem Header="Packages">
                    <MenuItem Header="Search" IsEnabled="{Binding Status.IsReady}" InputGestureText="Ctrl+Shift+F" Click="OnSearchViewClick">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource SearchIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="References" IsEnabled="{Binding Status.IsReady}" InputGestureText="Ctrl+Shift+R" Click="OnRefViewClick">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource SearchIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Favorite Directories" ItemsSource="{Binding CustomDirectories.Directories}" IsEnabled="{Binding Status.IsReady}">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource DirectoriesIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <MenuItem Header="Views">
                    <MenuItem Header="3D Viewer" Command="{Binding MenuCommand}" CommandParameter="Views_3dViewer">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource MeshIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Export Session" Command="{Binding MenuCommand}" CommandParameter="Views_ExportSession">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <StaticResource ResourceKey="ExportSessionIcon" />
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Audio Player" Command="{Binding MenuCommand}" CommandParameter="Views_AudioPlayer">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource AudioIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Image Merger" Command="{Binding MenuCommand}" CommandParameter="Views_ImageMerger">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource ImageMergerIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <MenuItem Header="Settings" Command="{Binding MenuCommand}" CommandParameter="Settings" />
                <MenuItem Header="Help" >
                    <MenuItem Header="Donate" Command="{Binding MenuCommand}" CommandParameter="Help_Donate">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource GiftIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Releases" Command="{Binding MenuCommand}" CommandParameter="Help_Releases">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource GitHubIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Bugs Report" Command="{Binding MenuCommand}" CommandParameter="Help_BugsReport">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource BugIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Discord Server" Command="{Binding MenuCommand}" CommandParameter="Help_Discord">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource DiscordIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="About FModel" Command="{Binding MenuCommand}" CommandParameter="Help_About">
                        <MenuItem.Icon>
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource InfoIcon}" />
                                </Canvas>
                            </Viewbox>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
            </Menu>

            <Grid Grid.Column="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Column="0" Text="Preview New Explorer System" VerticalAlignment="Center" />
                <CheckBox Grid.Column="1" Margin="5 2 5 0" Unchecked="FeaturePreviewOnUnchecked" KeyboardNavigation.TabNavigation="None" KeyboardNavigation.ControlTabNavigation="None"
                          IsChecked="{Binding FeaturePreviewNewAssetExplorer, Source={x:Static settings:UserSettings.Default}, Mode=TwoWay}"
                          Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}"/>
            </Grid>
        </Grid>

        <Grid x:Name="RootGrid" Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" MinWidth="400" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <GroupBox Grid.Column="0" adonisExtensions:LayerExtension.Layer="2"
                      Padding="0" Background="Transparent">
                <TabControl x:Name="LeftTabControl" SelectionChanged="OnTabItemChange" SelectedIndex="{Binding SelectedLeftTabIndex, Mode=TwoWay}">
                    <TabItem Style="{StaticResource TabItemFillSpace}" Header="Archives">
                        <DockPanel>
                            <Grid DockPanel.Dock="Top">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="5" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="Loading Mode" VerticalAlignment="Center" />
                                <ComboBox Grid.Row="0" Grid.Column="2" ItemsSource="{Binding LoadingModes.Modes}" IsEnabled="{Binding Status.IsReady}"
                                          SelectedItem="{Binding LoadingMode, Source={x:Static settings:UserSettings.Default}, Mode=TwoWay}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Converter={x:Static converters:EnumToStringConverter.Instance}}" />
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                                <Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Content="Load"
                                        Command="{Binding LoadingModes.LoadCommand}" IsEnabled="{Binding Status.IsReady}"
                                        CommandParameter="{Binding SelectedItems, ElementName=DirectoryFilesListBox}" />
                            </Grid>
                            <Grid DockPanel.Dock="Top" Grid.IsSharedSizeScope="True">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <Separator Grid.Row="0" Style="{StaticResource CustomSeparator}" Tag="GAME ARCHIVES" />
                                <ListBox Grid.Row="1" x:Name="DirectoryFilesListBox" Style="{StaticResource DirectoryFilesListBox}" MouseDoubleClick="OnMouseDoubleClick" />
                                <Separator Grid.Row="2" Style="{StaticResource CustomSeparator}" Tag="INFORMATION" />
                                <StackPanel Grid.Row="3" Orientation="Vertical" Margin="0 0 0 5">
                                    <Grid HorizontalAlignment="Stretch">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding SelectedItem.MountPoint, ElementName=DirectoryFilesListBox, FallbackValue='/', Converter={x:Static converters:TrimRightToLeftConverter.Instance}, ConverterParameter=275}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="Mount Point" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding SelectedItem.FileCount, ElementName=DirectoryFilesListBox, FallbackValue='0', StringFormat={}{0:N0} Files}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="1" Grid.Column="1" Text="File Count" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding SelectedItem.IsEncrypted, ElementName=DirectoryFilesListBox, FallbackValue='False'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="2" Grid.Column="1" Text="Is Encrypted" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding SelectedItem.Guid, ElementName=DirectoryFilesListBox, FallbackValue='00000000000000000000000000000000'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="3" Grid.Column="1" Text="Global Unique Identifier" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    </Grid>
                                </StackPanel>
                            </Grid>
                        </DockPanel>
                    </TabItem>
                    <TabItem Style="{StaticResource TabItemFillSpace}"
                             Header="Folders">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Grid Grid.Row="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="5" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <StackPanel Grid.Column="0" Orientation="Horizontal">
                                    <Image Source="/FModel;component/Resources/label.png"
                                           Width="16" Height="16" HorizontalAlignment="Center" Margin="0 0 3.5 0" />
                                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" TextTrimming="CharacterEllipsis">
                                        <TextBlock.Text>
                                            <MultiBinding StringFormat="{}'{0}' has {1} folders and {2} packages">
                                                <Binding Path="SelectedItem.Header" ElementName="AssetsFolderName" FallbackValue="None" />
                                                <Binding Path="SelectedItem.FoldersView.Count" ElementName="AssetsFolderName" FallbackValue="0" />
                                                <Binding Path="SelectedItem.AssetsList.Assets.Count" ElementName="AssetsFolderName" FallbackValue="0" />
                                            </MultiBinding>
                                        </TextBlock.Text>
                                    </TextBlock>
                                </StackPanel>
                                <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
                                    <Button Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}" ToolTip="Bring Selected Folder To View" Padding="4"
                                            Command="{Binding MenuCommand}" CommandParameter="{Binding SelectedItem, ElementName=AssetsFolderName}">
                                        <Viewbox Width="16" Height="16" HorizontalAlignment="Center">
                                            <Canvas Width="24" Height="24">
                                                <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource LocateMeIcon}" />
                                            </Canvas>
                                        </Viewbox>
                                    </Button>
                                    <!-- <Button Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}" ToolTip="Expand All (not appropriate for huge amount of folders)" Padding="4" -->
                                    <!--         Command="{Binding MenuCommand}" CommandParameter="ToolBox_Expand_All"> -->
                                    <!--     <Viewbox Width="16" Height="16" HorizontalAlignment="Center"> -->
                                    <!--         <Canvas Width="24" Height="24"> -->
                                    <!--             <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource UnfoldIcon}" /> -->
                                    <!--         </Canvas> -->
                                    <!--     </Viewbox> -->
                                    <!-- </Button> -->
                                    <Button Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}" ToolTip="Collapse All" Padding="4"
                                            Command="{Binding MenuCommand}" CommandParameter="ToolBox_Collapse_All">
                                        <Viewbox Width="16" Height="16" HorizontalAlignment="Center">
                                            <Canvas Width="24" Height="24">
                                                <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource FoldIcon}"/>
                                            </Canvas>
                                        </Viewbox>
                                    </Button>
                                </StackPanel>
                            </Grid>
                            <Separator Grid.Row="1" Style="{StaticResource CustomSeparator}" Margin="0" />
                            <TreeView Grid.Row="2"
                                      x:Name="AssetsFolderName"
                                      Style="{StaticResource AssetsFolderTreeView}"
                                      SelectedItemChanged="OnAssetsTreeSelectedItemChanged"
                                      PreviewKeyDown="OnFoldersPreviewKeyDown"
                                      PreviewMouseDoubleClick="OnAssetsTreeMouseDoubleClick">
                            </TreeView>
                            <Separator Grid.Row="3" Style="{StaticResource CustomSeparator}" Tag="INFORMATION" />
                            <StackPanel Grid.Row="4" Orientation="Vertical" Margin="0 0 0 5">
                                <Grid HorizontalAlignment="Stretch">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding SelectedItem.AssetsList.Assets.Count, ElementName=AssetsFolderName, FallbackValue=0, StringFormat={}{0:N0}}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <TextBlock Grid.Row="0" Grid.Column="1" Text="Packages Count" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding SelectedItem.FoldersView.Count, ElementName=AssetsFolderName, FallbackValue=0, StringFormat={}{0:N0}}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <TextBlock Grid.Row="1" Grid.Column="1" Text="Folders Count" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding SelectedItem.Archive, ElementName=AssetsFolderName, FallbackValue='None'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <TextBlock Grid.Row="2" Grid.Column="1" Text="Included In Archive" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding SelectedItem.MountPoint, ElementName=AssetsFolderName, FallbackValue='/', Converter={x:Static converters:TrimRightToLeftConverter.Instance}, ConverterParameter=275}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <TextBlock Grid.Row="3" Grid.Column="1" Text="Archive Mount Point" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding SelectedItem.Version, ElementName=AssetsFolderName, FallbackValue='VER_UE4_LATEST', Converter={x:Static converters:TrimRightToLeftConverter.Instance}, ConverterParameter=275}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <TextBlock Grid.Row="4" Grid.Column="1" Text="Archive Version" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                </Grid>
                            </StackPanel>
                        </Grid>
                    </TabItem>
                    <TabItem Style="{StaticResource TabItemFillSpace}"
                             Header="{Binding SelectedItem.AssetsList.Assets.Count, FallbackValue=0, ElementName=AssetsFolderName}"
                             HeaderStringFormat="{}{0} Packages">
                        <DockPanel>

                            <inputs:SearchTextBox DockPanel.Dock="Top" x:Name="AssetsSearchTextBox"
                                                  Text="{Binding SelectedItem.SearchText, ElementName=AssetsFolderName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                  ClearButtonClick="OnClearFilterClick" />

                            <Grid DockPanel.Dock="Top">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <controls:Breadcrumb Grid.Row="0" HorizontalAlignment="Left" Margin="0 5 0 5"
                                                     MaxWidth="{Binding ActualWidth, ElementName=AssetsSearchTextBox}"
                                                     DataContext="{Binding SelectedItem.PathAtThisPoint, ElementName=AssetsFolderName, FallbackValue='No/Directory/Detected/In/Folder'}"/>

                                <ListBox Grid.Row="1" x:Name="AssetsListName"
                                         Style="{StaticResource AssetsListBox}"
                                         PreviewMouseDoubleClick="OnAssetsListMouseDoubleClick"
                                         PreviewKeyDown="OnPreviewKeyDown" />

                                <Separator Grid.Row="2" Style="{StaticResource CustomSeparator}" Tag="INFORMATION" />
                                <StackPanel Grid.Row="3" Orientation="Vertical" Margin="0 0 0 5">
                                    <Grid HorizontalAlignment="Stretch">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding SelectedItem.Asset.Offset, ElementName=AssetsListName, FallbackValue=0, StringFormat='{}0x{0:X}'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="Offset" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding SelectedItem.Asset.Size, ElementName=AssetsListName, FallbackValue=0, Converter={x:Static converters:SizeToStringConverter.Instance}}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="1" Grid.Column="1" Text="Size" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding SelectedItem.Asset.CompressionMethod, ElementName=AssetsListName, FallbackValue='Unknown'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="2" Grid.Column="1" Text="Compression Method" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding SelectedItem.Asset.IsEncrypted, ElementName=AssetsListName, FallbackValue='False'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="3" Grid.Column="1" Text="Is Encrypted" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        <TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding SelectedItem.Asset.Vfs.Name, ElementName=AssetsListName, FallbackValue='None'}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        <TextBlock Grid.Row="4" Grid.Column="1" Text="Included In Archive" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    </Grid>
                                </StackPanel>
                            </Grid>
                        </DockPanel>
                    </TabItem>
                </TabControl>
            </GroupBox>

            <GridSplitter Grid.Column="1" ResizeDirection="Columns" Width="4" VerticalAlignment="Stretch"
                          ResizeBehavior="PreviousAndNext" MouseDoubleClick="OnGridSplitterDoubleClick"
                          Background="{DynamicResource {x:Static adonisUi:Brushes.Layer0BackgroundBrush}}" />

            <GroupBox Grid.Column="2" adonisExtensions:LayerExtension.Layer="2"
                      Padding="0" Background="Transparent">
                <Grid Margin="0 0 3 0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="0">
                        <Border BorderThickness="1" Padding="10"
                                BorderBrush="{DynamicResource {x:Static adonisUi:Brushes.Layer3BorderBrush}}"
                                Background="{DynamicResource {x:Static adonisUi:Brushes.Layer3BackgroundBrush}}"
                                Visibility="{Binding IsAssetsExplorerVisible, Converter={StaticResource BoolToVisibilityConverter}}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>

                                <Grid Grid.Row="0" adonisExtensions:LayerExtension.Layer="3">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition Width="Auto" MinWidth="150" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <inputs:SearchTextBox x:Name="AssetsExplorerSearch" Grid.Column="0"
                                                          Text="{Binding SelectedItem.SearchText, ElementName=AssetsFolderName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                          ClearButtonClick="OnClearFilterClick" />

                                    <ComboBox x:Name="CategoriesSelector" Grid.Column="2"
                                              ItemsSource="{Binding Categories}"
                                              SelectedItem="{Binding SelectedItem.SelectedCategory, ElementName=AssetsFolderName, Mode=TwoWay}" />

                                    <StackPanel Grid.Column="4"
                                                Orientation="Horizontal"
                                                HorizontalAlignment="Right">
                                        <ToggleButton Style="{StaticResource ExplorerViewToggleButton}"
                                                      Width="32"
                                                      Height="28"
                                                      Padding="7"
                                                      ToolTip="Grid View"
                                                      IsChecked="{Binding ExplorerViewMode,
                                                                  Source={x:Static local:Settings.UserSettings.Default},
                                                                  Converter={x:Static converters:EnumToBoolConverter.Instance},
                                                                  ConverterParameter={x:Static local:EExplorerViewMode.Grid},
                                                                  Mode=TwoWay}">
                                            <Path Data="{StaticResource GridIcon}"
                                                  Width="14"
                                                  Height="14"
                                                  Stretch="Uniform"
                                                  Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                                        </ToggleButton>
                                        <ToggleButton Style="{StaticResource ExplorerViewToggleButton}"
                                                      Width="32"
                                                      Height="28"
                                                      Padding="7"
                                                      ToolTip="List View"
                                                      IsChecked="{Binding ExplorerViewMode,
                                                                  Source={x:Static local:Settings.UserSettings.Default},
                                                                  Converter={x:Static converters:EnumToBoolConverter.Instance},
                                                                  ConverterParameter={x:Static local:EExplorerViewMode.List},
                                                                  Mode=TwoWay}">
                                            <Path Data="{StaticResource ListIcon}"
                                                  Width="14"
                                                  Height="14"
                                                  Stretch="Uniform"
                                                  Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                                        </ToggleButton>
                                    </StackPanel>
                                </Grid>

                                <controls:Breadcrumb Grid.Row="1" Margin="0 5 0 0"
                                                     HorizontalAlignment="Left"
                                                     DataContext="{Binding SelectedItem.PathAtThisPoint, ElementName=AssetsFolderName}" />

                                <Grid Grid.Row="2">
                                    <ListBox x:Name="AssetsExplorer"
                                             ItemsSource="{Binding SelectedItem.CombinedEntries, ElementName=AssetsFolderName, IsAsync=True}"
                                             Background="{DynamicResource {x:Static adonisUi:Brushes.Layer3BackgroundBrush}}"
                                             PreviewKeyDown="OnPreviewKeyDown">
                                        <ListBox.Style>
                                            <Style TargetType="ListBox"
                                                   BasedOn="{StaticResource TiledExplorer}">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ExplorerViewMode, Source={x:Static local:Settings.UserSettings.Default}}"
                                                                 Value="{x:Static local:EExplorerViewMode.List}">
                                                        <Setter Property="Visibility"
                                                                Value="Collapsed" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </ListBox.Style>
                                    </ListBox>
                                    <!-- once we need sorting, convert this to a listview (see search window) and add the header back (customize the template to re-add GridViewHeaderRowPresenter) -->
                                    <ListBox x:Name="AssetsListExplorer"
                                             ItemsSource="{Binding SelectedItem.CombinedEntries, ElementName=AssetsFolderName, IsAsync=True}"
                                             Background="{DynamicResource {x:Static adonisUi:Brushes.Layer3BackgroundBrush}}"
                                             PreviewKeyDown="OnPreviewKeyDown">
                                        <ListBox.Style>
                                            <Style TargetType="ListBox"
                                                   BasedOn="{StaticResource ListExplorer}">
                                                <Setter Property="Visibility"
                                                        Value="Collapsed" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ExplorerViewMode, Source={x:Static local:Settings.UserSettings.Default}}"
                                                                 Value="{x:Static local:EExplorerViewMode.List}">
                                                        <Setter Property="Visibility"
                                                                Value="Visible" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </ListBox.Style>
                                    </ListBox>
                                </Grid>
                            </Grid>
                        </Border>

                        <TabControl x:Name="TabControlName"
                                    Style="{StaticResource GameFilesTabControl}"
                                    Visibility="{Binding IsAssetsExplorerVisible, Converter={x:Static converters:InvertBoolToVisibilityConverter.Instance}, ConverterParameter=Hidden}" />
                    </Grid>

                    <Border Grid.Row="0"
                            VerticalAlignment="Bottom"
                            HorizontalAlignment="Right"
                            Margin="12,12,20,12"
                            Opacity="0.5"
                            Visibility="{Binding FeaturePreviewNewAssetExplorer, Source={x:Static settings:UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"
                            Background="{DynamicResource {x:Static adonisUi:Brushes.Layer2BackgroundBrush}}"
                            CornerRadius="8"
                            Padding="4"
                            Effect="{DynamicResource ShadowEffect}">
                        <Border.Triggers>
                            <EventTrigger RoutedEvent="MouseEnter">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0:0:0.2" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                            <EventTrigger RoutedEvent="MouseLeave">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                         To="0.5"
                                                         Duration="0:0:0.2" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                        </Border.Triggers>
                        <StackPanel Orientation="Horizontal"
                                    HorizontalAlignment="Center">
                            <ToggleButton Width="32"
                                          Height="32"
                                          Cursor="Hand"
                                          Margin="0,0,2,0"
                                          IsChecked="{Binding IsAssetsExplorerVisible, Mode=TwoWay}"
                                          Style="{StaticResource AssetsExplorerToggleButtonStyle}" />
                            <ToggleButton Width="32"
                                          Height="32"
                                          Cursor="Hand"
                                          Checked="OnPreviewTexturesToggled"
                                          Focusable="False"
                                          IsChecked="{Binding PreviewTexturesAssetExplorer, Source={x:Static settings:UserSettings.Default}, Mode=TwoWay}">
                                <ToggleButton.Style>
                                    <Style TargetType="ToggleButton"
                                           BasedOn="{StaticResource ModernToggleButtonStyle}">
                                        <Setter Property="ToolTip"
                                                Value="Preview Textures (OFF)" />
                                        <Style.Triggers>
                                            <Trigger Property="IsChecked"
                                                     Value="True">
                                                <Setter Property="Background"
                                                        Value="MediumPurple" />
                                                <Setter Property="ToolTip"
                                                        Value="Preview Textures (ON)" />
                                            </Trigger>
                                        </Style.Triggers>
                                    </Style>
                                </ToggleButton.Style>
                                <Viewbox Width="16"
                                         Height="16">
                                    <Canvas Width="24"
                                            Height="24">
                                        <Path Data="{StaticResource TextureIconAlt}"
                                              Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                                    </Canvas>
                                </Viewbox>
                            </ToggleButton>
                        </StackPanel>
                    </Border>

                    <Expander Grid.Row="1" Margin="0 5 0 5" ExpandDirection="Down"
                              IsExpanded="{Binding IsLoggerExpanded, Source={x:Static settings:UserSettings.Default}}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="2" />
                                <ColumnDefinition Width="24" />
                            </Grid.ColumnDefinitions>

                            <controls:CustomRichTextBox Grid.Column="0" Grid.ColumnSpan="3" x:Name="LogRtbName" Style="{StaticResource CustomRichTextBox}" />
                            <StackPanel Grid.Column="2" Orientation="Vertical" VerticalAlignment="Bottom" Margin="-5 -5 5 5">
                                <Button Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}" ToolTip="Open Output Folder" Padding="0,4,0,4"
                                        Command="{Binding MenuCommand}" CommandParameter="ToolBox_Open_Output_Directory" Focusable="False">
                                    <Viewbox Width="16" Height="16" HorizontalAlignment="Center">
                                        <Canvas Width="24" Height="24">
                                            <Path StrokeThickness="2" Stroke="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6" />
                                            <Path StrokeThickness="2" Stroke="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="M11 13l9 -9" />
                                            <Path StrokeThickness="2" Stroke="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="M15 4h5v5" />
                                        </Canvas>
                                    </Viewbox>
                                </Button>
                                <Button Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}" ToolTip="Clear Logs" Padding="0,4,0,4"
                                        Command="{Binding MenuCommand}" CommandParameter="ToolBox_Clear_Logs" Focusable="False">
                                    <Viewbox Width="16" Height="16" HorizontalAlignment="Center">
                                        <Canvas Width="24" Height="24">
                                            <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource TrashIcon}"/>
                                        </Canvas>
                                    </Viewbox>
                                </Button>
                            </StackPanel>
                        </Grid>
                    </Expander>
                </Grid>
            </GroupBox>
        </Grid>

        <StatusBar Grid.Row="3" MinHeight="28" MaxHeight="28"
                   adonisExtensions:LayerExtension.Layer="3">
            <StatusBar.Style>
                <Style TargetType="{x:Type StatusBar}" BasedOn="{StaticResource {x:Type StatusBar}}">
                    <Style.Triggers>
                        <!--don't mind me, MultiDataTrigger just sucks-->
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Ready}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Completed}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Loading}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.AlertBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Stopping}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.AlertBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Configuring}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.AlertBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Stopped}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.ErrorBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Failed}">
                            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.ErrorBrush}}" />
                            <Setter Property="Foreground" Value="White" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding StatusChangeAttempted, Source={x:Static services:ApplicationService.ThreadWorkerView}}" Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard Duration="0:0:0.8">
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(StatusBar.Background).(SolidColorBrush.Color)" FillBehavior="Stop">
                                            <ColorAnimationUsingKeyFrames.KeyFrames>
                                                <DiscreteColorKeyFrame KeyTime="0:0:0" Value="#CE5555" />
                                                <DiscreteColorKeyFrame KeyTime="0:0:0.2" Value="#C22B2B" />
                                                <DiscreteColorKeyFrame KeyTime="0:0:0.4" Value="#CE5555" />
                                                <DiscreteColorKeyFrame KeyTime="0:0:0.6" Value="#C22B2B" />
                                                <DiscreteColorKeyFrame KeyTime="0:0:0.8" Value="#CE5555" />
                                            </ColorAnimationUsingKeyFrames.KeyFrames>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding OperationCancelled, Source={x:Static services:ApplicationService.ThreadWorkerView}}" Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard Duration="0:0:1">
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(StatusBar.Background).(SolidColorBrush.Color)" FillBehavior="Stop">
                                            <ColorAnimationUsingKeyFrames.KeyFrames>
                                                <DiscreteColorKeyFrame KeyTime="0:0:0" Value="#C22B2B" />
                                                <DiscreteColorKeyFrame KeyTime="0:0:1" Value="#CE5555" />
                                            </ColorAnimationUsingKeyFrames.KeyFrames>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </StatusBar.Style>

            <StatusBarItem Margin="5,0,0,0" >
                <TextBlock>
                    <TextBlock.Style>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Text" Value="{Binding Status.Label}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Loading}">
                                    <Setter Property="Text" Value="{Binding Status.Label, StringFormat='{}{0} …'}" />
                                </DataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding CanBeCanceled, Source={x:Static services:ApplicationService.ThreadWorkerView}}" Value="True" />
                                        <Condition Binding="{Binding Status.Kind}" Value="{x:Static local:EStatusKind.Loading}" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Text" Value="{Binding Status.Label, StringFormat='{}{0} …    ESC to Cancel'}" />
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
            </StatusBarItem>

            <StatusBarItem Margin="0 0 5 0" Padding="0"
                           HorizontalAlignment="Right" VerticalAlignment="Stretch"
                           HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <StackPanel Orientation="Horizontal">
                    <StatusBarItem Margin="0 0 10 0" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                        <Button x:Name="ExportSessionButton"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Center"
                                Command="{Binding MenuCommand}" CommandParameter="Views_ExportSession">
                            <Button.Style>
                                <Style TargetType="Button"
                                       BasedOn="{StaticResource StatusBarButton}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Session.HasQueuedItems, Source={x:Static viewModels:ExportSessionViewModel.Instance}}"
                                                     Value="False">
                                            <Setter Property="Background"
                                                    Value="{Binding Background, RelativeSource={RelativeSource AncestorType=StatusBar}}" />
                                            <Setter Property="ToolTip"
                                                    Value="No items are currently queued for export." />
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding Session.HasQueuedItems, Source={x:Static viewModels:ExportSessionViewModel.Instance}}"
                                                     Value="True">
                                            <Setter Property="Background"
                                                    Value="{DynamicResource {x:Static adonisUi:Brushes.AlertBrush}}" />
                                            <Setter Property="ToolTip"
                                                    Value="There are items waiting in the export queue. Click to open the export session and process them!" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                            <StackPanel Orientation="Horizontal"
                                        VerticalAlignment="Center">
                                <Viewbox Width="16" Height="16">
                                    <StaticResource ResourceKey="ExportSessionIcon" />
                                </Viewbox>
                                <TextBlock Margin="10 0 0 0"
                                           Text="{Binding Session.TotalQueued, Source={x:Static viewModels:ExportSessionViewModel.Instance}, Mode=OneWay, StringFormat=Queued Items: {0}}"
                                           Visibility="{Binding Session.TotalQueued, Source={x:Static viewModels:ExportSessionViewModel.Instance}, Converter={x:Static converters:IntGreaterThanZeroToVisibilityConverter.Instance}}" />
                            </StackPanel>
                        </Button>
                    </StatusBarItem>

                    <StatusBarItem Margin="0">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                            <Viewbox Width="16" Height="16">
                                <Canvas Width="24" Height="24">
                                    <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}" Data="{StaticResource StatusBarIcon}" />
                                </Canvas>
                            </Viewbox>
                            <TextBlock Margin="10 0 0 0" Text="{Binding LastUpdateCheck, Source={x:Static settings:UserSettings.Default}, Converter={x:Static converters:RelativeDateTimeConverter.Instance}, StringFormat=Last Refresh: {0}}" />
                        </StackPanel>
                    </StatusBarItem>
                </StackPanel>
            </StatusBarItem>
        </StatusBar>

        <controls:DropOverlay Grid.Row="0" Grid.RowSpan="99" Panel.ZIndex="1000" />

        <Popup Grid.Row="0" Grid.RowSpan="99" Panel.ZIndex="999"
               PlacementTarget="{Binding ElementName=ExportSessionButton}" Placement="Custom"
               CustomPopupPlacementCallback="OnQueueToastCustomPopupPlacement"
               IsOpen="{Binding ShowQueueToast, Source={x:Static viewModels:ExportSessionViewModel.Instance}}"
               AllowsTransparency="True" IsHitTestVisible="False">
            <Border CornerRadius="5" Padding="10"
                    Background="{DynamicResource {x:Static adonisUi:Brushes.Layer2BackgroundBrush}}"
                    BorderBrush="{DynamicResource {x:Static adonisUi:Brushes.Layer1BorderBrush}}"
                    BorderThickness="1">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <Viewbox Width="28" Height="28" VerticalAlignment="Center" Margin="0 0 10 0">
                        <Canvas Width="24" Height="24">
                            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}"
                                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                                  Data="M8 9h8" />
                            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}"
                                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                                  Data="M8 13h6" />
                            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}"
                                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                                  Data="M15 18h-2l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5" />
                            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}"
                                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                                  Data="M19 16v3" />
                            <Path Stroke="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}"
                                  StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
                                  Data="M19 22v.01" />
                        </Canvas>
                    </Viewbox>
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock Text="Export Session" FontWeight="SemiBold"
                                   Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                        <TextBlock Text="{Binding ToolTip, ElementName=ExportSessionButton}"
                                   MaxWidth="300" TextWrapping="Wrap" FontSize="11"
                                   Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>
    </Grid>
</adonisControls:AdonisWindow>
