<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexGridSamples.Resources">

    <DataTemplate x:Key="ArtistIcon">
        <Path Data="M331.169,379.623 L331.167,370.167 C331.333,367.979 332.433,366.306 334.5,365.167 L350.81,358.759 C353.388,356.633 354.657,353.544 352.161,350.107 C350.819,348.235 348.232,341.639 348.355,338.326 C348.478,335.994 348.355,331.33 350.442,329.367 C352.636,327.493 354.683,326.328 357.664,326.073 C360.733,326.163 363.568,327.119 366.155,328.998 C367.628,330.594 368.006,334.141 367.833,337.167 C368.133,340.928 366.093,347.428 364.436,349.862 C362.702,353.345 363.007,356.863 365.295,359.005 C369.409,361.074 374.38,362.919 379.78,364.65 C382.133,365.428 384.068,367.528 384.167,370.5 L384.199,379.746 z" Fill="{ThemeResource ApplicationForegroundThemeBrush}" Stretch="Uniform" UseLayoutRounding="False"/>
    </DataTemplate>

    <DataTemplate x:Key="SongIcon">
        <Path Data="M311.916,464.085 L311.75,432.083 L347.583,423.083 L347.75,463.083 C347.667,467.417 344.056,470.05 339.917,470.583 C334.908,470.539 330.625,467.75 330.417,463.75 C330.25,459 335.75,455 341.25,456.751 L341.084,432.581 L318.748,437.917 L318.75,472.25 C318.5,475.583 314.345,478.026 310.417,478.25 C304.764,477.902 301.25,475.5 301.083,470.25 C301.125,465.875 306.833,462.583 311.916,464.085 z" Fill="{ThemeResource ApplicationForegroundThemeBrush}" Stretch="Uniform" UseLayoutRounding="False"/>
    </DataTemplate>

    <DataTemplate x:Key="StarIcon">
        <Path Data="M0.75,7.75685 L7.75,7.625 L10,0.875 L12.125,7.6113 L19.5,7.75 L13.75,11.875 L16.0998,18.9517 L10,14.25 L4.27532,18.9382 L6.375,12.125 z" Fill="{ThemeResource ApplicationForegroundThemeBrush}" Stretch="Uniform" UseLayoutRounding="False"/>
    </DataTemplate>

    <ControlTemplate x:Key="ExpandCollapseTemplate" TargetType="ToggleButton">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates" >
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="PointerOver" />
                    <VisualState x:Name="Pressed" />
                    <VisualState x:Name="Disabled" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates" >
                    <VisualState x:Name="Checked">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="CollapsedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="CheckedPointOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="CollapsedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Indeterminate" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates" >
                    <VisualState x:Name="Unfocused">
                    </VisualState>
                    <VisualState x:Name="Focused">
                    </VisualState>
                    <VisualState x:Name="PointerFocused">
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid x:Name="ExpandedGrid" Height="32" Width="32">
                <Grid x:Name="LineExpandedIcon" Background="{ThemeResource TextBoxBackgroundThemeBrush}" Width="22" Height="22">
                    <Rectangle StrokeThickness="2" Stroke="{ThemeResource CheckBoxForegroundThemeBrush}" Opacity="0.4"/>
                    <Rectangle Fill="{ThemeResource CheckBoxForegroundThemeBrush}" Width="10" Height="2"/>
                </Grid>
            </Grid>
            <!-- Collapse visual -->
            <Grid x:Name="CollapsedGrid" Height="32" Width="32">
                <Grid x:Name="LineCollapsedIcon" Background="{ThemeResource TextBoxBackgroundThemeBrush}" Width="22" Height="22">
                    <Rectangle StrokeThickness="2" Stroke="{ThemeResource CheckBoxForegroundThemeBrush}" Opacity="0.4"/>
                    <Path Data="M4,0 L6,0 L6,4 L10,4 L10,6 L6,6 L6,10 L4,10 L4,6 L0,6 L0,4 L4,4 z" Width="10" Height="10" Fill="{ThemeResource CheckBoxForegroundThemeBrush}" Stretch="Fill" />
                </Grid>
            </Grid>
            <!-- CheckBox content -->
            <ContentPresenter x:Name="Content" Grid.Column="1" 
        		Content="{TemplateBinding Content}" 
        		ContentTemplate="{TemplateBinding ContentTemplate}" 
        		IsHitTestVisible="true"  />
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="ExpandCollapsePhoneTemplate" TargetType="ToggleButton">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates" >
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="PointerOver" />
                    <VisualState x:Name="Pressed" />
                    <VisualState x:Name="Disabled" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates" >
                    <VisualState x:Name="Checked">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="CollapsedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="CheckedPointOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="CollapsedGrid" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Indeterminate" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates" >
                    <VisualState x:Name="Unfocused">
                    </VisualState>
                    <VisualState x:Name="Focused">
                    </VisualState>
                    <VisualState x:Name="PointerFocused">
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid x:Name="ExpandedGrid" Height="22" Width="22">
                <Grid x:Name="LineExpandedIcon" Background="{ThemeResource TextBoxBackgroundThemeBrush}" Width="13" Height="13">
                    <Rectangle StrokeThickness="2" Stroke="{ThemeResource CheckBoxForegroundThemeBrush}" Opacity="0.4"/>
                    <Rectangle Fill="{ThemeResource CheckBoxForegroundThemeBrush}" Width="7" Height="2"/>
                </Grid>
            </Grid>
            <!-- Collapse visual -->
            <Grid x:Name="CollapsedGrid" Height="22" Width="22">
                <Grid x:Name="LineCollapsedIcon" Background="{ThemeResource TextBoxBackgroundThemeBrush}" Width="13" Height="13">
                    <Rectangle StrokeThickness="2" Stroke="{ThemeResource CheckBoxForegroundThemeBrush}" Opacity="0.4"/>
                    <Path Data="M4,0 L6,0 L6,4 L10,4 L10,6 L6,6 L6,10 L4,10 L4,6 L0,6 L0,4 L4,4 z" Width="7" Height="7" Fill="{ThemeResource CheckBoxForegroundThemeBrush}" Stretch="Fill" />
                </Grid>
            </Grid>
            <!-- CheckBox content -->
            <ContentPresenter x:Name="Content" Grid.Column="1" 
        		Content="{TemplateBinding Content}" 
        		ContentTemplate="{TemplateBinding ContentTemplate}" 
        		IsHitTestVisible="true"  />
        </Grid>
    </ControlTemplate>

</ResourceDictionary>
