<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="using:Microsoft.Xaml.Interactivity"
    xmlns:ic="using:Microsoft.Xaml.Interactions.Core">
    <DataTemplate x:Key="ContainerItemTemplate">
        <Grid
            Margin="0"
            Padding="0"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch">
            <i:Interaction.Behaviors>
                <ic:DataTriggerBehavior
                    Binding="{Binding ViewMode, Converter={StaticResource EnumToStringConverter}}"
                    Value="Default">
                    <ic:ChangePropertyAction
                        PropertyName="Background"
                        Value="{ThemeResource ItemBackgroundBrush}" />
                    <ic:ChangePropertyAction
                        PropertyName="Foreground"
                        TargetObject="{Binding ElementName=DispalyText}"
                        Value="{ThemeResource ForegroundBrush}" />
                </ic:DataTriggerBehavior>
                <ic:DataTriggerBehavior
                    Binding="{Binding ViewMode, Converter={StaticResource EnumToStringConverter}}"
                    Value="Alternative">
                    <ic:ChangePropertyAction
                        PropertyName="Background"
                        Value="{ThemeResource AlternativeItemBackgroundBrush}" />
                    <ic:ChangePropertyAction
                        PropertyName="Foreground"
                        TargetObject="{Binding ElementName=DispalyText}"
                        Value="{ThemeResource AlternativeForegroundBrush}" />
                </ic:DataTriggerBehavior>
                <ic:DataTriggerBehavior
                    Binding="{Binding ViewMode, Converter={StaticResource EnumToStringConverter}}"
                    Value="Selected">
                    <ic:ChangePropertyAction
                        PropertyName="Background"
                        Value="{ThemeResource SelectedItemBackgroundBrush}" />
                    <ic:ChangePropertyAction
                        PropertyName="Foreground"
                        TargetObject="{Binding ElementName=DispalyText}"
                        Value="{ThemeResource SelectedItemForegroundBrush}" />
                </ic:DataTriggerBehavior>
            </i:Interaction.Behaviors>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Image
                Width="32"
                Height="32"
                Margin="10,0"
                Source="{Binding Converter={StaticResource ItemToImageConverter}}" />
            <TextBlock
                x:Name="DispalyText"
                Grid.Column="1"
                VerticalAlignment="Center"
                Text="{Binding Item.Name}" />
        </Grid>
    </DataTemplate>

    <Style
        x:Key="ContentListViewItemStyle"
        TargetType="ListViewItem">
        <Setter Property="FocusVisualPrimaryThickness" Value="0" />
        <Setter Property="FocusVisualSecondaryThickness" Value="0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <ContentPresenter HorizontalAlignment="Stretch" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="MainContentListViewItemStyle"
        BasedOn="{StaticResource ContentListViewItemStyle}"
        TargetType="ListViewItem">
        <Setter Property="IsTabStop" Value="True" />
    </Style>

    <Style
        x:Key="ContentListView"
        TargetType="ListView">
        <Setter Property="Transitions" Value="{x:Null}" />
        <Setter Property="ItemContainerTransitions" Value="{x:Null}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource MainContentListViewItemStyle}" />
        <Setter Property="ItemTemplate" Value="{StaticResource ContainerItemTemplate}" />
        <!--Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <ItemsPresenter />
                </ControlTemplate>
            </Setter.Value>
        </Setter-->
    </Style>

    <Style
        x:Key="NonMainContentListView"
        BasedOn="{StaticResource ContentListView}"
        TargetType="ListView">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="AllowFocusOnInteraction" Value="False" />
        <Setter Property="SelectionMode" Value="None" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource ContentListViewItemStyle}" />
    </Style>

</ResourceDictionary>
