<UserControl
    x:Class="JumpPoint.Uwp.Controls.JumpPointViewer"
    x:Name="jumpPointViewer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:JumpPoint.Uwp.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="using:Microsoft.Xaml.Interactivity"
    xmlns:core="using:Microsoft.Xaml.Interactions.Core"
    xmlns:conv="using:JumpPoint.Uwp.Converters"
    xmlns:helpers="using:JumpPoint.Uwp.Helpers"
    xmlns:items="using:JumpPoint.Platform.Items"
    xmlns:services="using:JumpPoint.Platform.Services"
    xmlns:winui="using:Microsoft.UI.Xaml.Controls"
    xmlns:ngconv="using:NittyGritty.Uwp.Converters"
    xmlns:tkbehaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
    xmlns:ngbehaviors="using:NittyGritty.Uwp.Interactivity.Behaviors"
    xmlns:platform="using:JumpPoint.Platform"
    xmlns:actions="using:JumpPoint.Uwp.Interactivity.Actions"
    xmlns:behaviors="using:JumpPoint.Uwp.Interactivity.Behaviors"
    xmlns:gtext="using:Glif.Core.Text"
    xmlns:commands="using:JumpPoint.ViewModels.Commands"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <UserControl.Resources>
        <CollectionViewSource x:Key="ItemsViewSource" x:Name="ItemsViewSource"/>
        <conv:NothingToShowConverter x:Name="NothingToShowConverter">
            <ngconv:Binding Value="{x:Bind IsLoading, Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind ItemsSource.Count, Mode=OneWay}" />
        </conv:NothingToShowConverter>

        <conv:AppBarSeparatorVisibilityConverter x:Key="OpenGroupSeparatorConverter">
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenWithEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenInNewTabEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenInNewWindowEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenInFileExplorerEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenInCommandPromptEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenInPowershellEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsOpenInWindowsTerminalEnabled(Context), Mode=OneWay}" />
        </conv:AppBarSeparatorVisibilityConverter>
        <conv:AppBarSeparatorVisibilityConverter x:Key="ToolsGroupSeparatorConverter">
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsAddToWorkspaceEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsAddToFavoritesEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsRemoveFromFavoritesEnabled(Context), Mode=OneWay}" />
        </conv:AppBarSeparatorVisibilityConverter>
        <conv:AppBarSeparatorVisibilityConverter x:Key="TemplateGroupSeparatorConverter">
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsSetWorkspaceTemplateEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:Toolbar.IsSetFolderTemplateEnabled(Context), Mode=OneWay}" />
        </conv:AppBarSeparatorVisibilityConverter>
        <conv:AppBarSeparatorVisibilityConverter x:Key="PathContextToolsGroupSeparatorConverter">
            <ngconv:Binding Value="{x:Bind commands:NavigationBar.IsAddToWorkspaceEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:NavigationBar.IsAddToFavoritesEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:NavigationBar.IsRemoveFromFavoritesEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:NavigationBar.IsSetWorkspaceTemplateEnabled(Context), Mode=OneWay}" />
            <ngconv:Binding Value="{x:Bind commands:NavigationBar.IsSetFolderTemplateEnabled(Context), Mode=OneWay}" />
        </conv:AppBarSeparatorVisibilityConverter>
        
        <winui:CommandBarFlyout x:Key="ItemContextFlyout" Placement="BottomEdgeAlignedLeft">
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource OpenCommand}"
                          IsEnabled="{x:Bind commands:Toolbar.IsOpenEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource CopyCommand}"
                          IsEnabled="{x:Bind commands:Toolbar.IsCopyEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource CutCommand}"
                          IsEnabled="{x:Bind commands:Toolbar.IsCutEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource DeleteCommand}"
                          IsEnabled="{x:Bind commands:Toolbar.IsDeleteEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource RenameCommand}"
                          IsEnabled="{x:Bind commands:Toolbar.IsRenameEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource ItemsPropertiesCommand}"
                          IsEnabled="{x:Bind commands:Toolbar.IsPropertiesEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            <winui:CommandBarFlyout.SecondaryCommands>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenWithCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenWithEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenItemsInNewTabCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenInNewTabEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenItemsInNewWindowCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenInNewWindowEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenItemsInFileExplorerCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenInFileExplorerEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenItemsInCommandPromptCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenInCommandPromptEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenItemsInPowershellCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenInPowershellEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenItemsInWindowsTerminalCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsOpenInWindowsTerminalEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarSeparator Visibility="{Binding Source={StaticResource OpenGroupSeparatorConverter}, Path=Output, Mode=OneWay}" /> 

                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource AddItemsToWorkspaceCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsAddToWorkspaceEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource AddItemsToFavoritesCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsAddToFavoritesEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource RemoveItemsFromFavoritesCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsRemoveFromFavoritesEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarSeparator Visibility="{Binding Source={StaticResource ToolsGroupSeparatorConverter}, Path=Output, Mode=OneWay}" />

                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource SetItemsWorkspaceTemplateCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsSetWorkspaceTemplateEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource SetItemsFolderTemplateCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsSetFolderTemplateEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarSeparator Visibility="{Binding Source={StaticResource TemplateGroupSeparatorConverter}, Path=Output, Mode=OneWay}" />

                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource CopyItemsPathCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsCopyItemsPathEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource DownloadItemsCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsDownloadEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource ShareItemsCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsShareEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource MoreToolsCommand}"
                              IsEnabled="{x:Bind commands:Toolbar.IsMoreToolsEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}"/>
            </winui:CommandBarFlyout.SecondaryCommands>
        </winui:CommandBarFlyout>

        <winui:CommandBarFlyout x:Key="PathContextFlyout" Placement="BottomEdgeAlignedLeft">
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource CopyPathCommand}" />
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource SharePathCommand}" />
            <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                          Command="{StaticResource PathPropertiesCommand}"
                          IsEnabled="{x:Bind commands:NavigationBar.IsPropertiesEnabled(Context), Mode=OneWay}"
                          Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
            <winui:CommandBarFlyout.SecondaryCommands>
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenPathInNewWindowCommand}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenPathInFileExplorerCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsOpenInFileExplorerEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenPathInCommandPromptCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsOpenInCommandPromptEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenPathInPowershellCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsOpenInPowershellEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource OpenPathInWindowsTerminalCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsOpenInWindowsTerminalEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarSeparator Visibility="{Binding Source={StaticResource PathContextToolsGroupSeparatorConverter}, Path=Output, Mode=OneWay}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource AddPathToWorkspaceCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsAddToWorkspaceEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource AddPathToFavoritesCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsAddToFavoritesEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource RemovePathFromFavoritesCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsRemoveFromFavoritesEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource SetPathWorkspaceTemplateCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsSetWorkspaceTemplateEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
                <AppBarButton CommandParameter="{x:Bind Context, Mode=OneWay}"
                              Command="{StaticResource SetPathFolderTemplateCommand}"
                              IsEnabled="{x:Bind commands:NavigationBar.IsSetFolderTemplateEnabled(Context), Mode=OneWay}"
                              Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsEnabled}" />
            </winui:CommandBarFlyout.SecondaryCommands>
        </winui:CommandBarFlyout>

        <Style x:Key="AllLayoutItemStyle"
               TargetType="ListViewItem"
               BasedOn="{StaticResource DefaultListViewItemStyle}">
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
            <Setter Property="Margin" Value="0" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="TabNavigation" Value="Local" />
        </Style>
        
        <!--#region Details View -->
        <Style x:Key="DetailsLayoutItemStyle"
               TargetType="ListViewItem" BasedOn="{StaticResource AllLayoutItemStyle}">
            <Setter Property="Padding"
                    Value="12,0" />
        </Style>

        <DataTemplate x:Key="FolderDetailsTemplate" x:DataType="items:FolderBase">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*" MinWidth="200" />
                    <ColumnDefinition Width="0.35*" MinWidth="150" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Image VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Width="20"
                       Height="20"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="24"
                                     DecodePixelWidth="24"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetFolderIconUri(FolderTemplate), Mode=OneWay}"/>
                    </Image.Source>
                </Image>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>

                <!-- Date -->
                <TextBlock Text="{x:Bind DateModified, Converter={StaticResource NullableDateTimeOffsetToLocalConverter}, ConverterParameter='N/A', Mode=OneWay}"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Margin="8,0"
                           Grid.Column="2" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>

                <!-- Type -->
                <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}" Margin="8,0"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="3" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>

                <!-- Size -->
                <TextBlock Text="{x:Bind Size, Converter={StaticResource ByteSizeConverter}, Mode=OneWay}"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="4" VerticalAlignment="Center"
                           HorizontalAlignment="Right" Margin="8,0"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="FileDetailsTemplate" x:DataType="items:FileBase">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*" MinWidth="200" />
                    <ColumnDefinition Width="0.35*" MinWidth="150" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Image Source="{x:Bind conv:FileThumbnailConverter.Convert(FileType, Thumbnail, 24, 0), Mode=OneWay}"
                       x:Phase="1"
                       VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Width="20"
                       Height="20"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}"/>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <Grid>
                        <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="NoWrap"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                        <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </Grid>
                </HyperlinkButton>

                <!-- Date -->
                <TextBlock Text="{x:Bind DateModified, Converter={StaticResource NullableDateTimeOffsetToLocalConverter}, ConverterParameter='N/A', Mode=OneWay}"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Margin="8,0"
                           Grid.Column="2" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>

                <!-- Type -->
                <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}" Margin="8,0"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="3" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>

                <!-- Size -->
                <TextBlock Text="{x:Bind Size, Converter={StaticResource ByteSizeConverter}, Mode=OneWay}"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="8,0"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="DriveDetailsTemplate" x:DataType="items:DriveBase">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*" MinWidth="200" />
                    <ColumnDefinition Width="0.35*" MinWidth="150" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Image VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Width="20"
                       Height="20"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="24"
                                     DecodePixelWidth="24"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetDriveIconUri(DriveTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="Wrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>

                <!-- Type -->
                <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}" Margin="8,0"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="3" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>

                <!-- Space -->
                <TextBlock Grid.Column="4"
                           VerticalAlignment="Center"
                           Margin="8,0"
                           TextWrapping="NoWrap"
                           TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                           Visibility="{x:Bind Capacity, Converter={StaticResource CollapsedWhenNullConverter}, Mode=OneWay}">
                    <Run Text="{x:Bind FreeSpace, Converter={StaticResource ByteSizeConverter}, Mode=OneWay}" />
                    <Run Text="free of" />
                    <Run Text="{x:Bind Capacity, Converter={StaticResource ByteSizeConverter}, Mode=OneWay}" />
                </TextBlock>

            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="WorkspaceDetailsTemplate" x:DataType="items:Workspace">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*" MinWidth="200" />
                    <ColumnDefinition Width="0.35*" MinWidth="150" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Viewbox VerticalAlignment="Center"
                         HorizontalAlignment="Center"
                         Width="20"
                         Height="20"
                         Loaded="OnIconLoaded">
                    <TextBlock FontFamily="Segoe UI Emoji"
                               IsColorFontEnabled="True"
                               Text="{x:Bind conv:IconConverter.GetWorkspaceGlyph(Template), Mode=OneWay}" />
                </Viewbox>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>

                <!-- Date -->
                <TextBlock Text="{x:Bind DateCreated, Converter={StaticResource NullableDateTimeOffsetToLocalConverter}, ConverterParameter='N/A', Mode=OneWay}"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Margin="8,0"
                           Grid.Column="2"
                           VerticalAlignment="Center"
                           TextWrapping="NoWrap"
                           TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" />

                <!-- Type -->
                <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}" Margin="8,0"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="3" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="LibraryDetailsTemplate" x:DataType="items:Library">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*" MinWidth="200" />
                    <ColumnDefinition Width="0.35*" MinWidth="150" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Viewbox VerticalAlignment="Center"
                         HorizontalAlignment="Center"
                         Width="20"
                         Height="20"
                         Loaded="OnIconLoaded">
                    <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE8F1;"
                              FontSize="20"/>
                </Viewbox>

                <!-- Name -->
                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8,0"
                      Grid.Column="1">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"
                               Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"/>
                    <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis" TextWrapping="Wrap"
                               Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"/>
                </Grid>

                <!-- Type -->
                <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}" Margin="8,0"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Grid.Column="3" VerticalAlignment="Center"
                           TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="AppLinkDetailsTemplate" x:DataType="items:AppLink">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*" MinWidth="200" />
                    <ColumnDefinition Width="0.35*" MinWidth="150" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                    <ColumnDefinition Width="0.25*" MinWidth="100" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Border Width="20"
                        Height="20"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        x:Phase="1"
                        Background="{x:Bind Background, Converter={StaticResource DrawingColorBrushConverter}, Mode=OneWay}"
                        Loaded="OnIconLoaded">
                    <Image Source="{x:Bind Logo, Converter={StaticResource AppLinkDetailsLogoConverter}, Mode=OneWay}"
                           Width="20"
                           Height="20"/>
                </Border>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>

                <!-- DisplayType -->
                <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}"
                           ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                           Margin="8,0"
                           Grid.Column="3"
                           VerticalAlignment="Center"
                           TextWrapping="NoWrap"
                           TextTrimming="CharacterEllipsis"
                           Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
            </Grid>
        </DataTemplate>
        
        <helpers:JumpPointItemTemplateSelector x:Key="DetailsTemplateSelector"
                                               FolderTemplate="{StaticResource FolderDetailsTemplate}"
                                               FileTemplate="{StaticResource FileDetailsTemplate}"
                                               DriveTemplate="{StaticResource DriveDetailsTemplate}"
                                               WorkspaceTemplate="{StaticResource WorkspaceDetailsTemplate}"
                                               LibraryTemplate="{StaticResource LibraryDetailsTemplate}"
                                               AppLinkTemplate="{StaticResource AppLinkDetailsTemplate}"/>
        <!--#endregion -->

        <!--#region Grid View -->
        <Style x:Key="GridLayoutItemStyle"
               TargetType="ListViewItem" BasedOn="{StaticResource AllLayoutItemStyle}">
            <Setter Property="Padding"
                    Value="4,0" />
        </Style>

        <DataTemplate x:Key="FolderGridTemplate" x:DataType="items:FolderBase">
            <Grid Width="120" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Image HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="58"
                                     DecodePixelWidth="58"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetFolderIconUri(FolderTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="8,0,8,8" Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <HyperlinkButton HorizontalAlignment="Center"
                                     HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   FontSize="14"
                                   HorizontalTextAlignment="Center"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>
                    <TextBlock Grid.Row="1" FontSize="12" HorizontalTextAlignment="Center"
                               Text="{x:Bind DisplayType, Mode=OneWay}" TextTrimming="CharacterEllipsis"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Visibility="{x:Bind FolderType, Converter={StaticResource CollapsedWhenRegularFolderConverter}, Mode=OneWay}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
                    <TextBlock Text="" FontSize="14" Grid.Row="2" />
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="FileGridTemplate" x:DataType="items:FileBase">
            <Grid Width="120" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Image Source="{x:Bind conv:FileThumbnailConverter.Convert(FileType, Thumbnail, 58, 0), Mode=OneWay}"
                       x:Phase="1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}" />

                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="8,0,8,8" Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <HyperlinkButton HorizontalAlignment="Center"
                                     HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <Grid>
                            <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                       ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                       FontSize="14"
                                       HorizontalTextAlignment="Center"
                                       TextTrimming="CharacterEllipsis"
                                       TextWrapping="Wrap"
                                       MaxLines="2"
                                       Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"
                                       FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                       FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                       FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                       FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                            <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                       ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                       FontSize="14"
                                       HorizontalTextAlignment="Center"
                                       TextTrimming="CharacterEllipsis"
                                       TextWrapping="Wrap"
                                       MaxLines="2"
                                       Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"
                                       FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                       FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                       FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                       FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                        </Grid>
                    </HyperlinkButton>
                    <TextBlock Text="" FontSize="14" Grid.Row="1" />
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="DriveGridTemplate" x:DataType="items:DriveBase">
            <Grid Width="120" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Image HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="58"
                                     DecodePixelWidth="58"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetDriveIconUri(DriveTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="8,0,8,8" Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <HyperlinkButton HorizontalAlignment="Center"
                                     HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   FontSize="14"
                                   HorizontalTextAlignment="Center"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>
                    <ProgressBar Grid.Row="1"
                                 VerticalAlignment="Stretch"
                                 Height="16"
                                 Margin="0,2"
                                 CornerRadius="4"
                                 Maximum="{x:Bind Capacity, Converter={StaticResource NullableUlongToDoubleConverter}, Mode=OneWay}"
                                 Minimum="0"
                                 Value="{x:Bind UsedSpace, Converter={StaticResource NullableUlongToDoubleConverter}, Mode=OneWay}"
                                 Visibility="{x:Bind Capacity, Converter={StaticResource CollapsedWhenNullConverter}, Mode=OneWay}"
                                 Foreground="{x:Bind conv:DriveStorageColorConverter.GetBrush(Capacity, UsedSpace), Mode=OneWay}"/>
                    <TextBlock Text="" FontSize="14" Grid.Row="2" />
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="WorkspaceGridTemplate" x:DataType="items:Workspace">
            <Grid Width="120" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Viewbox HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Width="48"
                         Height="48"
                         Loaded="OnIconLoaded">
                    <TextBlock FontFamily="Segoe UI Emoji"
                               IsColorFontEnabled="True"
                               Text="{x:Bind conv:IconConverter.GetWorkspaceGlyph(Template), Mode=OneWay}" />
                </Viewbox>

                <HyperlinkButton HorizontalAlignment="Center"
                                 VerticalAlignment="Top"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0,8,8"
                                 Grid.Row="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               FontSize="14"
                               HorizontalTextAlignment="Center"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="Wrap"
                               MaxLines="2"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="LibraryGridTemplate" x:DataType="items:Library">
            <Grid Width="120" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Viewbox HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Width="48"
                         Height="48"
                         Loaded="OnIconLoaded">
                    <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE8F1;" />
                </Viewbox>

                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="8,0,8,8" Grid.Row="1">
                    <TextBlock Text="{x:Bind Name}" FontSize="14" HorizontalTextAlignment="Center"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis" TextWrapping="Wrap" MaxLines="2"
                               Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"/>
                    <TextBlock Text="{x:Bind DisplayName}" FontSize="14" HorizontalTextAlignment="Center"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis" TextWrapping="Wrap" MaxLines="2"
                               Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"/>
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="AppLinkGridTemplate" x:DataType="items:AppLink">
            <Grid Width="120" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Border x:Phase="1"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Width="48"
                        Height="48"
                        Loaded="OnIconLoaded"
                        Background="{x:Bind Background, Converter={StaticResource DrawingColorBrushConverter}, Mode=OneWay}">
                    <Image Source="{x:Bind Logo, Converter={StaticResource AppLinkGridTilesLogoConverter}, Mode=OneWay}"
                           Width="48"
                           Height="48"/>
                </Border>

                <Grid HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Margin="8,0,8,8"
                      Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <HyperlinkButton HorizontalAlignment="Center"
                                     HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   FontSize="14"
                                   HorizontalTextAlignment="Center"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>
                    <TextBlock Grid.Row="1"
                               FontSize="12"
                               HorizontalTextAlignment="Center"
                               Text="{x:Bind DisplayType, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
                    <TextBlock Text=""
                               FontSize="14"
                               Grid.Row="2" />
                </Grid>
            </Grid>
        </DataTemplate>

        <helpers:JumpPointItemTemplateSelector x:Key="GridTemplateSelector"
                                               FolderTemplate="{StaticResource FolderGridTemplate}"
                                               FileTemplate="{StaticResource FileGridTemplate}"
                                               DriveTemplate="{StaticResource DriveGridTemplate}"
                                               WorkspaceTemplate="{StaticResource WorkspaceGridTemplate}"
                                               LibraryTemplate="{StaticResource LibraryGridTemplate}"
                                               AppLinkTemplate="{StaticResource AppLinkGridTemplate}"/>
        <!--#endregion-->

        <!--#region Tiles View -->
        <Style x:Key="TilesLayoutItemStyle"
               TargetType="ListViewItem" BasedOn="{StaticResource AllLayoutItemStyle}">
            <Setter Property="Padding"
                    Value="4,0" />
        </Style>

        <DataTemplate x:Key="FolderTilesTemplate" x:DataType="items:FolderBase">
            <Grid Width="320" MinHeight="80" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Image HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="58"
                                     DecodePixelWidth="58"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetFolderIconUri(FolderTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <StackPanel Grid.Column="1" Margin="2,12,8,0">
                    <!-- Name -->
                    <HyperlinkButton HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   HorizontalTextAlignment="Left"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontSize="14"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>

                    <!-- Date -->
                    <TextBlock Text="{x:Bind DateModified, Mode=OneWay, Converter={StaticResource NullableDateTimeOffsetToLocalConverter}}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Visibility="{x:Bind FolderType, Converter={StaticResource VisibleWhenRegularFolderConverter}, Mode=OneWay}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>

                    <!-- Display Type -->
                    <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Visibility="{x:Bind FolderType, Converter={StaticResource CollapsedWhenRegularFolderConverter}, Mode=OneWay}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="FileTilesTemplate" x:DataType="items:FileBase">
            <Grid Width="320" MinHeight="80" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Image Source="{x:Bind conv:FileThumbnailConverter.Convert(FileType, Thumbnail, 58, 0), Mode=OneWay}"
                       x:Phase="1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}" />

                <StackPanel Grid.Column="1" Margin="2,12,8,0">
                    <HyperlinkButton HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <Grid>
                            <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                       ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                       HorizontalTextAlignment="Left"
                                       TextTrimming="CharacterEllipsis"
                                       TextWrapping="Wrap"
                                       MaxLines="2"
                                       FontSize="14"
                                       Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"
                                       FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                       FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                       FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                       FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                            <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                       ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                       HorizontalTextAlignment="Left"
                                       TextTrimming="CharacterEllipsis"
                                       TextWrapping="Wrap"
                                       MaxLines="2"
                                       FontSize="14"
                                       Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"
                                       FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                       FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                       FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                       FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                        </Grid>
                    </HyperlinkButton>

                    <!-- Date -->
                    <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="DriveTilesTemplate" x:DataType="items:DriveBase">
            <Grid Width="320" MinHeight="80" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Image HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="58"
                                     DecodePixelWidth="58"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetDriveIconUri(DriveTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <Grid Grid.Column="1"
                      Margin="2,12,8,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <!-- Name -->
                    <HyperlinkButton HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   HorizontalTextAlignment="Left"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontSize="14"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>

                    <!-- Space -->
                    <ProgressBar Grid.Row="1"
                                 VerticalAlignment="Stretch"
                                 Height="16"
                                 Margin="0,4,0,2"
                                 CornerRadius="4"
                                 Maximum="{x:Bind Capacity, Converter={StaticResource NullableUlongToDoubleConverter}, Mode=OneWay}"
                                 Minimum="0"
                                 Value="{x:Bind UsedSpace, Converter={StaticResource NullableUlongToDoubleConverter}, Mode=OneWay}"
                                 Visibility="{x:Bind Capacity, Converter={StaticResource CollapsedWhenNullConverter}, Mode=OneWay}"
                                 Foreground="{x:Bind conv:DriveStorageColorConverter.GetBrush(Capacity, UsedSpace), Mode=OneWay}" />
                    <TextBlock Grid.Row="2"
                               VerticalAlignment="Center"
                               TextWrapping="NoWrap"
                               TextTrimming="CharacterEllipsis"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               Visibility="{x:Bind Capacity, Converter={StaticResource CollapsedWhenNullConverter}, Mode=OneWay}">
                        <Run Text="{x:Bind FreeSpace, Converter={StaticResource ByteSizeConverter}, Mode=OneWay}" />
                        <Run Text="free of" />
                        <Run Text="{x:Bind Capacity, Converter={StaticResource ByteSizeConverter}, Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Text=""
                               FontSize="14"
                               Grid.Row="3" />
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="WorkspaceTilesTemplate" x:DataType="items:Workspace">
            <Grid Width="320" Height="80" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Viewbox HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Width="48"
                         Height="48"
                         Loaded="OnIconLoaded">
                    <TextBlock FontFamily="Segoe UI Emoji"
                               IsColorFontEnabled="True"
                               Text="{x:Bind conv:IconConverter.GetWorkspaceGlyph(Template), Mode=OneWay}" />
                </Viewbox>

                <StackPanel Grid.Column="1" Margin="2,12,8,0">
                    <!-- Name -->
                    <HyperlinkButton HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   HorizontalTextAlignment="Left"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontSize="14"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>

                    <!-- Type -->
                    <TextBlock Text="{x:Bind DisplayType}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="LibraryTilesTemplate" x:DataType="items:Library">
            <Grid Width="320" Height="80" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Viewbox HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Width="48"
                         Height="48"
                         Loaded="OnIconLoaded">
                    <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE8F1;"
                          FontSize="48" />
                </Viewbox>

                <StackPanel Grid.Column="1" Margin="2,12,8,0">
                    <!-- Name -->
                    <Grid HorizontalAlignment="Stretch">
                        <TextBlock Text="{x:Bind Name}" HorizontalTextAlignment="Left"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   TextTrimming="CharacterEllipsis" TextWrapping="Wrap" MaxLines="2" FontSize="14"
                                   Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"/>
                        <TextBlock Text="{x:Bind DisplayName}" HorizontalTextAlignment="Left"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   TextTrimming="CharacterEllipsis" TextWrapping="Wrap" MaxLines="2" FontSize="14"
                                   Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"/>
                    </Grid>

                    <!-- Type -->
                    <TextBlock Text="{x:Bind DisplayType}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="AppLinkTilesTemplate"
                      x:DataType="items:AppLink">
            <Grid Width="320" MinHeight="80" Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Border x:Phase="1"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Width="48"
                        Height="48"
                        Loaded="OnIconLoaded"
                        Background="{x:Bind Background, Converter={StaticResource DrawingColorBrushConverter}, Mode=OneWay}">
                    <Image Source="{x:Bind Logo, Converter={StaticResource AppLinkGridTilesLogoConverter}, Mode=OneWay}"
                           Width="48"
                           Height="48"/>
                </Border>

                <Grid Grid.Column="1"
                      Margin="2,12,8,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <!-- Name -->
                    <HyperlinkButton HorizontalContentAlignment="Stretch"
                                     Padding="0"
                                     Click="OnItemOpened"
                                     Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                        <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   HorizontalTextAlignment="Left"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   MaxLines="2"
                                   FontSize="14"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </HyperlinkButton>

                    <!-- DisplayType -->
                    <TextBlock Text="{x:Bind DisplayType, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                               TextWrapping="NoWrap"
                               TextTrimming="CharacterEllipsis"
                               Grid.Row="1" />
                </Grid>
            </Grid>
        </DataTemplate>

        <helpers:JumpPointItemTemplateSelector x:Key="TilesTemplateSelector"
                                               FolderTemplate="{StaticResource FolderTilesTemplate}"
                                               FileTemplate="{StaticResource FileTilesTemplate}"
                                               DriveTemplate="{StaticResource DriveTilesTemplate}"
                                               WorkspaceTemplate="{StaticResource WorkspaceTilesTemplate}"
                                               LibraryTemplate="{StaticResource LibraryTilesTemplate}"
                                               AppLinkTemplate="{StaticResource AppLinkTilesTemplate}"/>
        <!--#endregion-->

        <!--#region List View -->
        <Style x:Key="ListLayoutItemStyle"
               TargetType="ListViewItem"
               BasedOn="{StaticResource AllLayoutItemStyle}">
            <Setter Property="Padding"
                    Value="12,0" />
        </Style>

        <DataTemplate x:Key="FolderListTemplate"
                      x:DataType="items:FolderBase">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*"
                                      MinWidth="200" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Image VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Width="20"
                       Height="20"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="24"
                                     DecodePixelWidth="24"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetFolderIconUri(FolderTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="FileListTemplate"
                      x:DataType="items:FileBase">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*"
                                      MinWidth="200" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Image Source="{x:Bind conv:FileThumbnailConverter.Convert(FileType, Thumbnail, 24, 0), Mode=OneWay}"
                       x:Phase="1"
                       VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Width="20"
                       Height="20"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}" />

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <Grid>
                        <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="NoWrap"
                                   Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                        <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                                   ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                                   TextTrimming="CharacterEllipsis"
                                   TextWrapping="Wrap"
                                   Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}"
                                   FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                                   FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                                   FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                                   FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                    </Grid>
                </HyperlinkButton>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="DriveListTemplate"
                      x:DataType="items:DriveBase">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*"
                                      MinWidth="200" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Image VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Width="20"
                       Height="20"
                       Loaded="OnIconLoaded"
                       Opacity="{x:Bind Attributes, Mode=OneWay, Converter={StaticResource HiddenOpacityConverter}}">
                    <Image.Source>
                        <BitmapImage DecodePixelHeight="24"
                                     DecodePixelWidth="24"
                                     DecodePixelType="Logical"
                                     UriSource="{x:Bind conv:IconConverter.GetDriveIconUri(DriveTemplate), Mode=OneWay}" />
                    </Image.Source>
                </Image>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="Wrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="WorkspaceListTemplate"
                      x:DataType="items:Workspace">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*"
                                      MinWidth="200" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Viewbox VerticalAlignment="Center"
                         HorizontalAlignment="Center"
                         Width="20"
                         Height="20"
                         Loaded="OnIconLoaded">
                    <TextBlock FontFamily="Segoe UI Emoji"
                               IsColorFontEnabled="True"
                               Text="{x:Bind conv:IconConverter.GetWorkspaceGlyph(Template), Mode=OneWay}" />
                </Viewbox>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="LibraryListTemplate"
                      x:DataType="items:Library">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*"
                                      MinWidth="200" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Viewbox VerticalAlignment="Center"
                         HorizontalAlignment="Center"
                         Width="20"
                         Height="20"
                         Loaded="OnIconLoaded">
                    <FontIcon FontFamily="Segoe MDL2 Assets"
                              Glyph="&#xE8F1;"
                              FontSize="20" />
                </Viewbox>

                <!-- Name -->
                <Grid HorizontalAlignment="Stretch"
                      VerticalAlignment="Center"
                      Margin="8,0"
                      Grid.Column="1">
                    <TextBlock Text="{x:Bind Name, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Mode=OneWay}" />
                    <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="Wrap"
                               Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowFileExtension, Converter={StaticResource VisibleWhenFalseConverter}, Mode=OneWay}" />
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="AppLinkListTemplate"
                      x:DataType="items:AppLink">
            <Grid Background="Transparent"
                  ContextFlyout="{StaticResource ItemContextFlyout}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" />
                    <ColumnDefinition Width="*"
                                      MinWidth="200" />
                </Grid.ColumnDefinitions>

                <!-- Icon -->
                <Border Width="20"
                        Height="20"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        x:Phase="1"
                        Background="{x:Bind Background, Converter={StaticResource DrawingColorBrushConverter}, Mode=OneWay}"
                        Loaded="OnIconLoaded">
                    <Image Source="{x:Bind Logo, Converter={StaticResource AppLinkDetailsLogoConverter}, Mode=OneWay}"
                           Width="20"
                           Height="20" />
                </Border>

                <!-- Name -->
                <HyperlinkButton VerticalAlignment="Center"
                                 HorizontalContentAlignment="Stretch"
                                 Margin="8,0"
                                 Grid.Column="1"
                                 Padding="0"
                                 Click="OnItemOpened"
                                 Foreground="{ThemeResource ApplicationForegroundThemeBrush}">
                    <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}"
                               ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}"
                               TextTrimming="CharacterEllipsis"
                               TextWrapping="NoWrap"
                               FontFamily="{x:Bind helpers:ServiceLocator.AppSettings.Font, Mode=OneWay}"
                               FontStyle="{x:Bind gtext:FontStyleExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStyle), Mode=OneWay}"
                               FontWeight="{x:Bind gtext:FontWeightExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontWeight), Mode=OneWay}"
                               FontStretch="{x:Bind gtext:FontStretchExtensions.ToPlatform(helpers:ServiceLocator.AppSettings.FontStretch), Mode=OneWay}" />
                </HyperlinkButton>
            </Grid>
        </DataTemplate>

        <helpers:JumpPointItemTemplateSelector x:Key="ListTemplateSelector"
                                               FolderTemplate="{StaticResource FolderListTemplate}"
                                               FileTemplate="{StaticResource FileListTemplate}"
                                               DriveTemplate="{StaticResource DriveListTemplate}"
                                               WorkspaceTemplate="{StaticResource WorkspaceListTemplate}"
                                               LibraryTemplate="{StaticResource LibraryListTemplate}"
                                               AppLinkTemplate="{StaticResource AppLinkListTemplate}" />
        <!--#endregion-->

    </UserControl.Resources>

    <Grid RowSpacing="4">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="GridState">
                    <VisualState.StateTriggers>
                        <local:EqualityTrigger LeftValue="{x:Bind Context.Settings.Layout, Mode=OneWay}"
                                               RightValue="{x:Bind platform:LayoutModes.Grid}" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="allView.Padding"
                                Value="4,0,4,12" /><!-- 4,0,-10,12 -->
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollBarVisibility)"
                                Value="Disabled" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollMode)"
                                Value="Disabled" />
                        <Setter Target="allView.(ScrollViewer.IsHorizontalRailEnabled)"
                                Value="False" />
                        <Setter Target="allView.ItemTemplateSelector"
                                Value="{StaticResource GridTemplateSelector}" />
                        <Setter Target="allView.ItemContainerStyle"
                                Value="{StaticResource GridLayoutItemStyle}" />
                        <Setter Target="allView.ItemsPanel">
                            <Setter.Value>
                                <ItemsPanelTemplate>
                                    <ItemsWrapGrid Orientation="Horizontal"
                                                   AreStickyGroupHeadersEnabled="False" />
                                </ItemsPanelTemplate>
                            </Setter.Value>
                        </Setter>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="DetailsState">
                    <VisualState.StateTriggers>
                        <local:EqualityTrigger LeftValue="{x:Bind Context.Settings.Layout, Mode=OneWay}"
                                               RightValue="{x:Bind platform:LayoutModes.Details}" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="allView.Padding"
                                Value="4,0,4,12" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollBarVisibility)"
                                Value="Auto" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollMode)"
                                Value="Enabled" />
                        <Setter Target="allView.(ScrollViewer.IsHorizontalRailEnabled)"
                                Value="True" />
                        <Setter Target="allView.ItemTemplateSelector"
                                Value="{StaticResource DetailsTemplateSelector}" />
                        <Setter Target="allView.ItemContainerStyle"
                                Value="{StaticResource DetailsLayoutItemStyle}" />
                        <Setter Target="allView.ItemsPanel">
                            <Setter.Value>
                                <ItemsPanelTemplate>
                                    <ItemsStackPanel AreStickyGroupHeadersEnabled="False" />
                                </ItemsPanelTemplate>
                            </Setter.Value>
                        </Setter>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="TilesState">
                    <VisualState.StateTriggers>
                        <local:EqualityTrigger LeftValue="{x:Bind Context.Settings.Layout, Mode=OneWay}"
                                               RightValue="{x:Bind platform:LayoutModes.Tiles}" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="allView.Padding"
                                Value="4,0,4,12" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollBarVisibility)"
                                Value="Disabled" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollMode)"
                                Value="Disabled" />
                        <Setter Target="allView.(ScrollViewer.IsHorizontalRailEnabled)"
                                Value="False" />
                        <Setter Target="allView.ItemTemplateSelector"
                                Value="{StaticResource TilesTemplateSelector}" />
                        <Setter Target="allView.ItemContainerStyle"
                                Value="{StaticResource TilesLayoutItemStyle}" />
                        <Setter Target="allView.ItemsPanel">
                            <Setter.Value>
                                <ItemsPanelTemplate>
                                    <ItemsWrapGrid Orientation="Horizontal"
                                                   AreStickyGroupHeadersEnabled="False" />
                                </ItemsPanelTemplate>
                            </Setter.Value>
                        </Setter>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="ListState">
                    <VisualState.StateTriggers>
                        <local:EqualityTrigger LeftValue="{x:Bind Context.Settings.Layout, Mode=OneWay}"
                                               RightValue="{x:Bind platform:LayoutModes.List}" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="allView.Padding"
                                Value="4,0,4,12" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollBarVisibility)"
                                Value="Disabled" />
                        <Setter Target="allView.(ScrollViewer.HorizontalScrollMode)"
                                Value="Disabled" />
                        <Setter Target="allView.(ScrollViewer.IsHorizontalRailEnabled)"
                                Value="False" />
                        <Setter Target="allView.ItemTemplateSelector"
                                Value="{StaticResource ListTemplateSelector}" />
                        <Setter Target="allView.ItemContainerStyle"
                                Value="{StaticResource ListLayoutItemStyle}" />
                        <Setter Target="allView.ItemsPanel">
                            <Setter.Value>
                                <ItemsPanelTemplate>
                                    <ItemsWrapGrid Orientation="Horizontal"
                                                   AreStickyGroupHeadersEnabled="False" />
                                </ItemsPanelTemplate>
                            </Setter.Value>
                        </Setter>
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <ContentControl Content="{x:Bind Header, Mode=OneWay}"
                        HorizontalContentAlignment="Stretch"
                        x:Name="viewHeader"/>

        <SemanticZoom Grid.Row="1"
                      x:Name="semanticZoom">
            <SemanticZoom.ZoomedInView>
                <ListView x:Name="allView"
                          ScrollViewer.IsVerticalScrollChainingEnabled="False"
                          IsDoubleTapEnabled="True"
                          IsMultiSelectCheckBoxEnabled="{x:Bind helpers:ServiceLocator.AppSettings.ShowCheckbox, Mode=OneWay}"
                          SelectionMode="{x:Bind helpers:ServiceLocator.AppSettings.ShowCheckbox, Converter={StaticResource MultipleWhenTrueConverter}, Mode=OneWay}"
                          ItemsSource="{x:Bind ItemsViewSource.View, Mode=OneWay}"
                          AllowDrop="True"
                          CanDragItems="True">
                    <ListView.Header>
                        <Grid x:Name="gridDetailsHeader"
                              Height="36"
                              Margin="-4,0"
                              Padding="16,0,24,0"
                              Visibility="{x:Bind GetDetailsHeaderVisibility(Context.Settings.Layout), Mode=OneWay}"
                              Background="{ThemeResource SystemChromeAltHighColor}"
                              Tapped="OnDetailsHeaderTapped">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="28" />
                                <ColumnDefinition Width="*"
                                                  MinWidth="200" />
                                <ColumnDefinition Width="0.35*"
                                                  MinWidth="150" />
                                <ColumnDefinition Width="0.25*"
                                                  MinWidth="100" />
                                <ColumnDefinition Width="0.25*"
                                                  MinWidth="100" />
                            </Grid.ColumnDefinitions>
                            <CheckBox Visibility="{x:Bind helpers:ServiceLocator.AppSettings.ShowCheckbox, Mode=OneWay}"
                                      Unchecked="OnCheckboxUnchecked"
                                      Checked="OnCheckboxChecked"
                                      Margin="0,0,12,0"
                                      MinWidth="0"
                                      MinHeight="0"
                                      Padding="0"
                                      VerticalAlignment="Center" />

                            <TextBlock Margin="8,0"
                                       Grid.Column="2"
                                       Text="Name"
                                       VerticalAlignment="Center"
                                       FontWeight="SemiBold" />
                            <TextBlock Margin="8,0"
                                       Grid.Column="3"
                                       Text="Date"
                                       VerticalAlignment="Center"
                                       FontWeight="SemiBold" />
                            <TextBlock Margin="8,0"
                                       Grid.Column="4"
                                       Text="Type"
                                       VerticalAlignment="Center"
                                       FontWeight="SemiBold" />
                            <TextBlock Margin="8,0"
                                       Grid.Column="5"
                                       Text="Size"
                                       VerticalAlignment="Center"
                                       FontWeight="SemiBold" />
                        </Grid>
                    </ListView.Header>
                    <ListView.GroupStyle>
                        <GroupStyle HidesIfEmpty="True">
                            <GroupStyle.HeaderContainerStyle>
                                <Style TargetType="ListViewHeaderItem">
                                    <Setter Property="FontSize"
                                            Value="16" />
                                    <Setter Property="FontWeight"
                                            Value="SemiBold" />
                                    <Setter Property="Foreground"
                                            Value="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
                                    <Setter Property="Margin"
                                            Value="0,2,0,0" />
                                    <Setter Property="Padding"
                                            Value="12,4" />
                                    <Setter Property="HorizontalAlignment"
                                            Value="Stretch" />
                                    <Setter Property="HorizontalContentAlignment"
                                            Value="Stretch" />
                                    <Setter Property="VerticalContentAlignment"
                                            Value="Stretch" />
                                    <Setter Property="MinHeight"
                                            Value="0" />
                                    <Setter Property="UseSystemFocusVisuals"
                                            Value="{StaticResource UseSystemFocusVisuals}" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="ListViewHeaderItem">
                                                <ContentPresenter x:Name="ContentPresenter"
                                                                  Background="{TemplateBinding Background}"
                                                                  BorderBrush="{TemplateBinding BorderBrush}"
                                                                  BorderThickness="{TemplateBinding BorderThickness}"
                                                                  CornerRadius="{TemplateBinding CornerRadius}"
                                                                  Margin="{TemplateBinding Margin}"
                                                                  Padding="{TemplateBinding Padding}"
                                                                  Content="{TemplateBinding Content}"
                                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                  ContentTransitions="{TemplateBinding ContentTransitions}"
                                                                  HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                                                  HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </GroupStyle.HeaderContainerStyle>
                            <GroupStyle.HeaderTemplate>
                                <DataTemplate>
                                    <Grid ColumnSpacing="8">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Text="{Binding Key}" />
                                        <TextBlock Text="{Binding Items.Count, Converter={StaticResource StringFormatConverter}, ConverterParameter='({0})'}"
                                                   Grid.Column="1" />
                                        <MenuFlyoutSeparator Padding="0,2,0,0"
                                                             VerticalAlignment="Center"
                                                             Grid.Column="2" />
                                    </Grid>
                                </DataTemplate>
                            </GroupStyle.HeaderTemplate>
                        </GroupStyle>
                    </ListView.GroupStyle>
                    <ListView.ItemContainerTransitions>
                        <TransitionCollection>
                            <EntranceThemeTransition IsStaggeringEnabled="False"
                                                     FromVerticalOffset="0"
                                                     FromHorizontalOffset="50" />
                            <AddDeleteThemeTransition />
                        </TransitionCollection>
                    </ListView.ItemContainerTransitions>
                    <i:Interaction.Behaviors>
                        <behaviors:JumpPointItemMultiSelectBehavior SelectedItems="{x:Bind SelectedItems, Mode=OneWay}" />
                        <behaviors:JumpPointViewerDragDropBehavior Context="{x:Bind Context, Mode=OneWay}"
                                                                   CopyCommand="{Binding Source={StaticResource Locator}, Path=CommandHelper.CopyToCommand}"
                                                                   MoveCommand="{Binding Source={StaticResource Locator}, Path=CommandHelper.MoveToCommand}"/>
                        <ngbehaviors:RightTappedSelectionBehavior />
                        <behaviors:PathContextBehavior Flyout="{StaticResource PathContextFlyout}" />
                        <core:EventTriggerBehavior EventName="Tapped">
                            <actions:OpenCommandBarFlyoutAction CommandBarFlyout="{StaticResource ItemContextFlyout}"
                                                                ShowMode="Transient" />
                            <actions:TappedSelectionAction AssociatedObject="{x:Bind allView}" />
                        </core:EventTriggerBehavior>
                        <core:EventTriggerBehavior EventName="DoubleTapped">
                            <core:InvokeCommandAction Command="{StaticResource OpenItemCommand}"
                                                      InputConverter="{StaticResource ItemDoubleClickEventArgsConverter}"
                                                      InputConverterParameter="{x:Bind Context.TabKey, Mode=OneWay}"/>
                        </core:EventTriggerBehavior>
                        <!--<behaviors:RubberBandSelectionBehavior RubberBand="{x:Bind rectRubberBand}" />-->
                        <tkbehaviors:StickyHeaderBehavior />
                        <!--<tkbehaviors:FadeHeaderBehavior HeaderElement="{x:Bind viewHeader}" />-->
                    </i:Interaction.Behaviors>
                </ListView>
            </SemanticZoom.ZoomedInView>
            <SemanticZoom.ZoomedOutView>
                <ListView ItemsSource="{x:Bind ItemsViewSource.View.CollectionGroups, Mode=OneWay}"
                          SelectionMode="Single"
                          Padding="4">
                    <ListView.ItemContainerStyle>
                        <Style TargetType="ListViewItem">
                            <Setter Property="HorizontalContentAlignment"
                                    Value="Stretch" />
                            <Setter Property="VerticalContentAlignment"
                                    Value="Stretch" />
                            <Setter Property="Padding"
                                    Value="20,8" />
                        </Style>
                    </ListView.ItemContainerStyle>
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal"
                                        Spacing="8">
                                <TextBlock Text="{Binding Group.Key}"
                                           FontSize="16"
                                           FontWeight="SemiBold"/>
                                <TextBlock Text="{Binding Group.Items.Count, Converter={StaticResource StringFormatConverter}, ConverterParameter='({0})'}"
                                           FontSize="16"
                                           FontWeight="SemiBold" />
                            </StackPanel>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </SemanticZoom.ZoomedOutView>
        </SemanticZoom>

        <StackPanel Grid.RowSpan="2"
                    Margin="12"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    Visibility="{x:Bind NothingToShowConverter.Output, Mode=OneWay}">
            <Image HorizontalAlignment="Center"
                   Width="96"
                   Height="96">
                <Image.Source>
                    <BitmapImage DecodePixelHeight="96"
                                 DecodePixelWidth="96"
                                 DecodePixelType="Logical"
                                 UriSource="/Assets/Icons/Empty.png" />
                </Image.Source>
            </Image>
            <TextBlock Text="Nothing to show"
                       Style="{StaticResource SubtitleTextBlockStyle}"
                       HorizontalAlignment="Center" />

            <ContentControl Content="{x:Bind QuickActions, Mode=OneWay}"
                            HorizontalContentAlignment="Stretch"
                            HorizontalAlignment="Center"
                            x:Name="quickActions" />
        </StackPanel>

        <!--<Canvas HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Grid.Row="1">
            <Rectangle x:Name="rectRubberBand"
                       Canvas.Left="0"
                       Canvas.Top="0"
                       Width="0"
                       Height="0"
                       Fill="{ThemeResource SystemAccentColor}"
                       Opacity=".5"
                       Stroke="{ThemeResource SystemAccentColorLight1}"
                       StrokeThickness="1" />
        </Canvas>-->
    </Grid>
</UserControl>
