<adonisControls:AdonisWindow x:Class="FModel.Views.ExportSessionWindow"
                             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                             mc:Ignorable="d" d:DesignWidth="512" d:DesignHeight="512"
                             d:DataContext="{d:DesignInstance Type=vm:ExportSessionViewModel, IsDesignTimeCreatable=False}"

                             xmlns:vm="clr-namespace:FModel.ViewModels"
                             xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
                             xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI"
                             xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI"
                             xmlns:converters="clr-namespace:FModel.Views.Resources.Converters"
                             xmlns:controls="clr-namespace:FModel.Views.Resources.Controls"
                             xmlns:serilog="clr-namespace:Serilog.Events;assembly=Serilog"
                             xmlns:c4pMeshes="clr-namespace:CUE4Parse_Conversion.Options;assembly=CUE4Parse-Conversion"

                             DataContext="{x:Static vm:ExportSessionViewModel.Instance}"
                             WindowStartupLocation="CenterScreen" ResizeMode="NoResize" IconVisibility="Collapsed"
                             Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenHeight}, Converter={converters:RatioConverter}, ConverterParameter='0.75'}"
                             Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.40'}">
    <adonisControls:AdonisWindow.Style>
        <Style TargetType="adonisControls:AdonisWindow" BasedOn="{StaticResource {x:Type adonisControls:AdonisWindow}}">
            <Setter Property="Title" Value="Export Session" />
        </Style>
    </adonisControls:AdonisWindow.Style>

    <adonisControls:AdonisWindow.Resources>
        <Style x:Key="StretchTreeViewItemStyle" TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItemStyle}">
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel />
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TreeViewItem">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                            </Grid.RowDefinitions>

                            <Border x:Name="Border"
                                    Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding adonisExtensions:CornerRadiusExtension.CornerRadius}" />

                            <Border x:Name="SpotlightLayer"
                                    Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                                    Background="{TemplateBinding adonisExtensions:CursorSpotlightExtension.BackgroundBrush}"
                                    BorderBrush="{TemplateBinding adonisExtensions:CursorSpotlightExtension.BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding adonisExtensions:CornerRadiusExtension.CornerRadius}"
                                    adonisExtensions:CursorSpotlightExtension.MouseEventSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=TreeViewItem}}"
                                    SnapsToDevicePixels="False" />

                            <ToggleButton x:Name="Expander"
                                          Grid.Row="0" Grid.Column="0"
                                          Width="16" Height="16"
                                          Margin="8,0,8,0"
                                          Focusable="False" ClickMode="Press"
                                          Foreground="{TemplateBinding Foreground}"
                                          IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
                                          RenderTransformOrigin="0.5,0.5">
                                <ToggleButton.Template>
                                    <ControlTemplate TargetType="ToggleButton">
                                        <Viewbox Width="16" Height="16" HorizontalAlignment="Center">
                                            <Canvas Width="24" Height="24" Background="Transparent">
                                                <Path Fill="{TemplateBinding Foreground}"
                                                      Data="{StaticResource ArrowIcon}" />
                                            </Canvas>
                                        </Viewbox>
                                    </ControlTemplate>
                                </ToggleButton.Template>
                                <ToggleButton.RenderTransform>
                                    <RotateTransform x:Name="ExpanderRotateTransform" Angle="-90" />
                                </ToggleButton.RenderTransform>
                            </ToggleButton>

                            <ContentPresenter x:Name="PART_Header"
                                              Grid.Row="0" Grid.Column="1"
                                              ContentSource="Header"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="0,4,8,4" />

                            <ItemsPresenter x:Name="ItemsHost"
                                            Grid.Row="1" Grid.Column="1" />
                        </Grid>

                        <ControlTemplate.Triggers>
                            <Trigger Property="IsExpanded" Value="False">
                                <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
                            </Trigger>
                            <Trigger Property="IsExpanded" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="ExpanderRotateTransform"
                                                             Storyboard.TargetProperty="Angle"
                                                             Duration="0:0:0.2" To="0" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="ExpanderRotateTransform"
                                                             Storyboard.TargetProperty="Angle"
                                                             Duration="0:0:0.2" From="0" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.ExitActions>
                            </Trigger>
                            <Trigger Property="HasItems" Value="False">
                                <Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Key="LogEntryTemplate" DataType="{x:Type vm:LogEntryViewModel}">
            <Grid Margin="0 1" ToolTip="{Binding Exception}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Viewbox Grid.Column="0" Width="16" Height="16" Margin="0 0 5 0" VerticalAlignment="Center">
                    <Canvas Width="24" Height="24">
                        <Path x:Name="LevelIcon"
                              Fill="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}"
                              Data="{StaticResource BugIcon}" />
                    </Canvas>
                </Viewbox>
                <TextBlock Grid.Column="1" Text="{Binding Timestamp, StringFormat='[{0:HH:mm:ss.fff}]'}"
                           FontSize="11" Margin="0 0 5 0" VerticalAlignment="Center"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
                <TextBlock Grid.Column="2"
                           Text="{Binding Message}" FontSize="11" VerticalAlignment="Center"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Verbose}">
                    <Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource NoteIcon}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Debug}">
                    <Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource BugIcon}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Information}">
                    <Setter TargetName="LevelIcon" Property="Fill" Value="#42A5F5" />
                    <Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource InfoIcon}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Warning}">
                    <Setter TargetName="LevelIcon" Property="Fill" Value="#FFA726" />
                    <Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource WarningIcon}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Error}">
                    <Setter TargetName="LevelIcon" Property="Fill" Value="#EF5350" />
                    <Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource CloseIcon}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Fatal}">
                    <Setter TargetName="LevelIcon" Property="Fill" Value="#EF5350" />
                    <Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource CloseIcon}" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

        <DataTemplate x:Key="ObjectGroupHeaderTemplate" DataType="{x:Type vm:ObjectGroupViewModel}">
            <Grid VerticalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Viewbox Grid.Column="0" Width="16" Height="16" Margin="0 0 5 0" VerticalAlignment="Center"
                        Visibility="{Binding HasErrors, Converter={StaticResource BoolToVisibilityConverter}}">
                    <Canvas Width="24" Height="24">
                        <Path Fill="#EF5350" Data="{StaticResource CloseIcon}" />
                    </Canvas>
                </Viewbox>

                <TextBlock Grid.Column="1" Text="{Binding Name}" VerticalAlignment="Center"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}"
                           ToolTip="{Binding Path}" />

                <Button Grid.Column="3" ToolTip="Remove from queue" Click="OnRemoveFromQueueClick"
                        Visibility="{Binding DataContext.CanExport, RelativeSource={RelativeSource AncestorType=adonisControls:AdonisWindow}, Converter={StaticResource BoolToVisibilityConverter}}"
                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" Margin="0" Focusable="False"
                        Foreground="#EF5350" Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}">
                    <Viewbox Width="16" Height="16">
                        <Canvas Width="24" Height="24">
                            <Path Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}"
                                  Data="{StaticResource RemoveIcon}" />
                        </Canvas>
                    </Viewbox>
                </Button>

                <Button Grid.Column="4" ToolTip="Open in Explorer" Click="OnOpenInExplorerClick"
                        Tag="{Binding FirstFilePath}"
                        Visibility="{Binding HasFilePath, Converter={StaticResource BoolToVisibilityConverter}}"
                        Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}"
                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" Margin="0">
                    <Viewbox Width="16" Height="16">
                        <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>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="ClassGroupHeaderTemplate" DataType="{x:Type vm:ClassGroupViewModel}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Column="0" FontWeight="SemiBold" Text="{Binding Name}" VerticalAlignment="Center" />

                <Grid Grid.Column="1" Margin="5 0 0 0"
                      Visibility="{Binding HasErrors, Converter={StaticResource BoolToVisibilityConverter}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <Viewbox Grid.Column="0" Width="16" Height="16" VerticalAlignment="Center" Margin="0 0 5 0">
                        <Canvas Width="24" Height="24">
                            <Path Fill="#EF5350" Data="{StaticResource CloseIcon}" />
                        </Canvas>
                    </Viewbox>
                    <TextBlock Grid.Column="1" Text="{Binding ErrorCount}" Foreground="#EF5350" VerticalAlignment="Center" />
                </Grid>

                <TextBlock Grid.Column="2" VerticalAlignment="Center" Margin="5 0 0 0"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}"
                           Text="{Binding Objects.Count, Mode=OneWay, StringFormat='({0})'}"
                           ToolTip="Assets sharing the same name across different packages are grouped together in this view. Exports are not affected."/>
            </Grid>
        </DataTemplate>
    </adonisControls:AdonisWindow.Resources>

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

        <DockPanel Grid.Row="0" Margin="10">
            <Grid DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Right">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                           Text="{Binding ElapsedTime, Mode=OneWay, Converter={x:Static converters:TimeSpanConverter.Instance}, ConverterParameter=elapsed, FallbackValue=00:00.00}"
                           FontSize="16" FontWeight="SemiBold" HorizontalAlignment="Right"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                <TextBlock Grid.Row="1" Grid.Column="1" FontSize="10" HorizontalAlignment="Right">
                    <Run Text="ETA " Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
                    <Run Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}"
                         Text="{Binding EtaTime, Mode=OneWay, Converter={x:Static converters:TimeSpanConverter.Instance}, FallbackValue=--:--}" />
                </TextBlock>
                <TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                           FontSize="10" HorizontalAlignment="Right"
                           TextTrimming="CharacterEllipsis" MaxWidth="220">
                    <TextBlock.Style>
                        <Style TargetType="TextBlock">
                            <Setter Property="Text" Value="{Binding CurrentItemName, Mode=OneWay, FallbackValue=/}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsCanceled}" Value="True">
                                    <Setter Property="Text" Value="Export canceled" />
                                    <Setter Property="Foreground" Value="#EF5350" />
                                </DataTrigger>
                                <DataTrigger Binding="{Binding IsFinished}" Value="True">
                                    <Setter Property="Text" Value="Export finished" />
                                    <Setter Property="Foreground" Value="#66BB6A" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
            </Grid>

            <Grid DockPanel.Dock="Left" VerticalAlignment="Center" HorizontalAlignment="Left">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <TextBlock Grid.Row="0" Grid.Column="0"
                           Text="{Binding Session.TotalQueued, Mode=OneWay, FallbackValue=0}"
                           FontSize="20" FontWeight="SemiBold"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                <TextBlock Grid.Row="1" Grid.Column="0" Text="in queue" FontSize="10"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />

                <Rectangle Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Width="1" Margin="16 2"
                           Fill="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />

                <TextBlock Grid.Row="0" Grid.Column="2"
                           Text="{Binding CompletedCount, Mode=OneWay, FallbackValue=0}"
                           FontSize="20" FontWeight="SemiBold"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
                <TextBlock Grid.Row="1" Grid.Column="2" Text="completed" FontSize="10"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />

                <Rectangle Grid.Row="0" Grid.RowSpan="2" Grid.Column="3" Width="1" Margin="16 2"
                           Fill="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />

                <TextBlock Grid.Row="0" Grid.Column="4"
                           Text="{Binding SucceededCount, Mode=OneWay, FallbackValue=0}"
                           FontSize="20" FontWeight="SemiBold" Foreground="#66BB6A" />
                <TextBlock Grid.Row="1" Grid.Column="4" Text="succeeded" FontSize="10"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />

                <TextBlock Grid.Row="0" Grid.Column="5" Margin="5 0 0 0"
                           Text="{Binding FailedCount, Mode=OneWay, FallbackValue=0}"
                           FontSize="20" FontWeight="SemiBold" Foreground="#EF5350" />
                <TextBlock Grid.Row="1" Grid.Column="5" Text="failed" FontSize="10" Margin="5 0 0 0"
                           Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
            </Grid>
        </DockPanel>

        <ProgressBar Grid.Row="1" Height="5" Margin="0 5 0 5" Maximum="1" Value="{Binding ProgressValue, Mode=OneWay, FallbackValue=0.5}" />

        <TabControl Grid.Row="2" adonisExtensions:LayerExtension.Layer="2"
                    Background="{DynamicResource {x:Static adonisUi:Brushes.Layer0BackgroundBrush}}">
            <TabItem Header="Export Logs">
                <Grid>
                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="13"
                               Text="Start an export to see results here." FontWeight="SemiBold"
                               Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsRunning}" Value="False" />
                                            <Condition Binding="{Binding ClassGroups.Count}" Value="0" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>

                    <TreeView ItemsSource="{Binding ClassGroups}"
                              VirtualizingPanel.IsVirtualizing="True"
                              VirtualizingPanel.VirtualizationMode="Recycling"
                              VirtualizingPanel.ScrollUnit="Item"
                              ScrollViewer.CanContentScroll="True">
                        <TreeView.ItemContainerStyle>
                            <Style TargetType="TreeViewItem" BasedOn="{StaticResource StretchTreeViewItemStyle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=TreeView}, Path=Items.Count}" Value="1">
                                        <Setter Property="IsExpanded" Value="True" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TreeView.ItemContainerStyle>
                        <TreeView.ItemTemplate>
                            <HierarchicalDataTemplate DataType="{x:Type vm:ClassGroupViewModel}" ItemsSource="{Binding Objects}"
                                                      ItemContainerStyle="{StaticResource StretchTreeViewItemStyle}">
                                <ContentPresenter Content="{Binding}"
                                                  ContentTemplate="{StaticResource ClassGroupHeaderTemplate}"
                                                  HorizontalAlignment="Stretch" />

                                <HierarchicalDataTemplate.ItemTemplate>
                                    <HierarchicalDataTemplate DataType="{x:Type vm:ObjectGroupViewModel}" ItemsSource="{Binding Entries}"
                                                              ItemContainerStyle="{StaticResource StretchTreeViewItemStyle}">
                                        <ContentPresenter Content="{Binding}"
                                                          ContentTemplate="{StaticResource ObjectGroupHeaderTemplate}"
                                                          HorizontalAlignment="Stretch" />

                                        <HierarchicalDataTemplate.ItemTemplate>
                                            <DataTemplate DataType="{x:Type vm:LogEntryViewModel}">
                                                <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource LogEntryTemplate}" />
                                            </DataTemplate>
                                        </HierarchicalDataTemplate.ItemTemplate>
                                    </HierarchicalDataTemplate>
                                </HierarchicalDataTemplate.ItemTemplate>
                            </HierarchicalDataTemplate>
                        </TreeView.ItemTemplate>
                    </TreeView>
                </Grid>
            </TabItem>

            <TabItem Header="Export Options" adonisExtensions:LayerExtension.Layer="2">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

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

                            <CheckBox Grid.Column="0"
                                      IsChecked="{Binding Options.OverrideOptions, Mode=TwoWay}"
                                      Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}"
                                      Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}" />
                            <TextBlock Grid.Column="1" VerticalAlignment="Center" FontSize="11" Margin="5 2 0 0"
                                       Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}"
                                       Text="Override default export options for this session"
                                       Visibility="{Binding Options.HasFeedback, Converter={x:Static converters:InvertBoolToVisibilityConverter.Instance}}" />
                            <TextBlock Grid.Column="1" VerticalAlignment="Center" FontSize="11" Margin="5 2 0 0"
                                       Foreground="{DynamicResource {x:Static adonisUi:Brushes.AccentBrush}}"
                                       FontWeight="SemiBold" Text="{Binding Options.FeedbackMessage}"
                                       Visibility="{Binding Options.HasFeedback, Converter={StaticResource BoolToVisibilityConverter}}" />

                            <Button Grid.Column="2" Click="OnMakeDefaultOptions" ToolTip="Save current options as your default settings"
                                    Padding="4" BorderThickness="1" Margin="5 0 0 0"
                                    IsEnabled="{Binding Options.OverrideOptions}" Focusable="False"
                                    Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}">
                                <Viewbox Width="16" Height="16">
                                    <Canvas Width="24" Height="24">
                                        <Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource SaveIcon}" />
                                    </Canvas>
                                </Viewbox>
                            </Button>
                            <Button Grid.Column="3" Click="OnResetOptions" ToolTip="Reset all options to default settings"
                                    Padding="4" BorderThickness="1" Margin="5 0 0 0"
                                    IsEnabled="{Binding Options.OverrideOptions}" Focusable="False"
                                    Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}">
                                <Viewbox Width="16" Height="16">
                                    <Canvas Width="24" Height="24">
                                        <Path StrokeThickness="2" Stroke="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" />
                                        <Path StrokeThickness="2" Stroke="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" />
                                    </Canvas>
                                </Viewbox>
                            </Button>
                        </Grid>

                        <Separator Grid.Row="1" Style="{StaticResource CustomSeparator}" Margin="0 5 0 10" />

                        <controls:ExportOptionsControl Grid.Row="2"
                                                       DataContext="{Binding Options}"
                                                       IsEnabled="{Binding OverrideOptions}" />
                    </Grid>
                </ScrollViewer>
            </TabItem>
        </TabControl>

        <Border Grid.Row="3"
                Background="{DynamicResource {x:Static adonisUi:Brushes.Layer1BackgroundBrush}}"
                adonisExtensions:LayerExtension.IncreaseLayer="True">
            <Grid Margin="30, 12, 6, 12">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <Button Grid.Column="1" MinWidth="78" Margin="0 0 12 0" IsDefault="False" IsCancel="True"
                        Visibility="{Binding IsRunning, Converter={StaticResource BoolToVisibilityConverter}}"
                        HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Cancel" Click="OnCancelClick"
                        Style="{DynamicResource {x:Static adonisUi:Styles.AccentButton}}">
                    <Button.Resources>
                        <SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AccentBrush}" Color="#E53935" />
                        <SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AccentHighlightBrush}" Color="#EF5350" />
                        <SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AccentIntenseHighlightBrush}" Color="#EF5350" />
                        <SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AccentInteractionBrush}" Color="#C62828" />
                        <SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AccentInteractionBorderBrush}" Color="#B71C1C" />
                    </Button.Resources>
                </Button>

                <Button Grid.Column="2" MinWidth="78" Margin="0 0 12 0" IsDefault="False" IsCancel="False"
                        IsEnabled="{Binding CanExport}"
                        HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Clear Queue" Click="OnClearQueueClick">
                    <Button.Style>
                        <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
                            <Setter Property="Visibility" Value="Visible" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsRunning}" Value="True">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </DataTrigger>
                                <DataTrigger Binding="{Binding IsFinished}" Value="True">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Button.Style>
                </Button>

                <Button Grid.Column="3" MinWidth="78" Margin="0 0 12 0" IsDefault="False" IsCancel="False"
                        HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Export"
                        IsEnabled="{Binding CanExport}"
                        Visibility="{Binding IsFinished, Converter={x:Static converters:InvertBoolToVisibilityConverter.Instance}}"
                        Click="OnExportClick" />

                <Button Grid.Column="3" MinWidth="78" Margin="0 0 12 0" IsDefault="False" IsCancel="False"
                        HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="OK"
                        Visibility="{Binding IsFinished, Converter={StaticResource BoolToVisibilityConverter}}"
                        Click="OnOkClick" />
            </Grid>
        </Border>
    </Grid>
</adonisControls:AdonisWindow>
