<Application
    x:Class="ControlExplorer.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ControlExplorer">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Default">
                    <SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#FF1D1D1D"/>
                    <SolidColorBrush x:Key="ControlExplorerBackgroundThemeBrush" Color="#E5000000"/>
                    <SolidColorBrush x:Key="ControlExplorerMainTitleThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkStripeThemeBrush" Color="#FF2C383D"/>
                    <SolidColorBrush x:Key="ControlExplorerLightStripeThemeBrush" Color="#555b9e"/>
                    <!-- old value #FF0AC2FF -->
                    <SolidColorBrush x:Key="ControlExplorerDarkForegroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerLightForegroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerBodyBackgroundThemeBrush" Color="#FF1D1D1D"/>
                    <SolidColorBrush x:Key="ControlExplorerLeftPanelThemeBrush" Color="Black"/>
                    <SolidColorBrush x:Key="ControlExplorerSimpleTextForegroundThemeBrush" Color="White"/>
                    <SolidColorBrush x:Key="ControlExplorerHyperlinkThemeBrush" Color="#555b9e"/>
                    <SolidColorBrush x:Key="ControlExplorerIconBackgroundThemeBrush" Color="#FF333333"/>
                    <SolidColorBrush x:Key="ControlExplorerIconThemeBrush" Color="#FFFFFFFF"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="Light">
                    <SolidColorBrush x:Key="ControlExplorerBackgroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerMainTitleThemeBrush" Color="#FF2C383D"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkStripeThemeBrush" Color="#FF2C383D"/>
                    <SolidColorBrush x:Key="ControlExplorerLightStripeThemeBrush" Color="#555b9e"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkForegroundThemeBrush" Color="#FF2C383D"/>
                    <SolidColorBrush x:Key="ControlExplorerLightForegroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerBodyBackgroundThemeBrush" Color="#FFF2F2F2"/>
                    <SolidColorBrush x:Key="ControlExplorerLeftPanelThemeBrush" Color="White"/>
                    <SolidColorBrush x:Key="ControlExplorerSimpleTextForegroundThemeBrush" Color="#FF2C383D"/>
                    <SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#FFF2F2F2"/>
                    <SolidColorBrush x:Key="ControlExplorerHyperlinkThemeBrush" Color="#555b9e"/>
                    <SolidColorBrush x:Key="ControlExplorerIconBackgroundThemeBrush" Color="#FF2C383D"/>
                    <SolidColorBrush x:Key="ControlExplorerIconThemeBrush" Color="#FFFFFFFF"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="HighContrast">
                    <SolidColorBrush x:Key="ControlExplorerBackgroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerMainTitleThemeBrush" Color="#FFFFFF00"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkStripeThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerLightStripeThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkForegroundThemeBrush" Color="#FFFFFF00"/>
                    <SolidColorBrush x:Key="ControlExplorerLightForegroundThemeBrush" Color="#FFFFFF00"/>
                    <SolidColorBrush x:Key="ControlExplorerBodyBackgroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerLeftPanelThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerSimpleTextForegroundThemeBrush" Color="#FFFFFF00"/>
                    <SolidColorBrush x:Key="ControlExplorerHyperlinkThemeBrush" Color="#FF8080FF"/>
                    
                    <SolidColorBrush x:Key="ControlExplorerIconBackgroundThemeBrush" Color="#FF222222"/>
                    <SolidColorBrush x:Key="ControlExplorerIconThemeBrush" Color="#FFFFFFFF"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="HighContrastBlack">
                    <SolidColorBrush x:Key="ControlExplorerBackgroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerMainTitleThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkStripeThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerLightStripeThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkForegroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerLightForegroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerBodyBackgroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerLeftPanelThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerSimpleTextForegroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerHyperlinkThemeBrush" Color="#FFFFFF00"/>
                    <SolidColorBrush x:Key="ControlExplorerIconBackgroundThemeBrush" Color="#FF222222"/>
                    <SolidColorBrush x:Key="ControlExplorerIconThemeBrush" Color="#FFFFFFFF"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="HighContrastWhite">
                    <SolidColorBrush x:Key="ControlExplorerBackgroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerMainTitleThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkStripeThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerLightStripeThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerDarkForegroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerLightForegroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerBodyBackgroundThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerLeftPanelThemeBrush" Color="#FFFFFFFF"/>
                    <SolidColorBrush x:Key="ControlExplorerSimpleTextForegroundThemeBrush" Color="#FF000000"/>
                    <SolidColorBrush x:Key="ControlExplorerHyperlinkThemeBrush" Color="#FF00009F"/>
                    <SolidColorBrush x:Key="ControlExplorerIconBackgroundThemeBrush" Color="#FFF0F0F0"/>
                    <SolidColorBrush x:Key="ControlExplorerIconThemeBrush" Color="#FF000000"/>
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>

            <ResourceDictionary.MergedDictionaries>

                <!-- 
                    Styles that define common aspects of the platform look and feel
                    Required by Visual Studio project and item templates
                 -->
                <ResourceDictionary Source="Resources/ControlIcons.xaml" />
                <ResourceDictionary Source="Resources/SampleIcons.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <!-- Application-specific resources -->

            <SolidColorBrush x:Key="IconDarkBlueBackground" Color="#FF0577AF"/>
            <SolidColorBrush x:Key="IconLightBlueBackground" Color="#FF47B1DC"/>
            <SolidColorBrush x:Key="ControlExplorerHubSectionHeaderThemeBrush" Color="#FFFFFFFF"/>

            <Style x:Key="SubheaderTextStyle" TargetType="TextBlock" >
                <Setter Property="FontFamily" Value="Segoe WP"/>
                <Setter Property="FontSize" Value="20"/>
                <Setter Property="FontWeight" Value="Light"/>
            </Style>

            <!-- Item templates -->
            <!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage -->
            <DataTemplate x:Key="Standard250x250ItemTemplate">
                <Grid HorizontalAlignment="Left" Width="250" Height="250">
                    <Border Background="{StaticResource ListViewItemSelectedBackgroundThemeBrush}">
                        <ContentControl ContentTemplate="{Binding Icon}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="50"/>
                    </Border>
                    <Border VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}" Height="80">
                        <TextBlock Text="{Binding Name}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" VerticalAlignment="Bottom" FontSize="20" Margin="15"/>

                        <!--<TextBlock Text="{Binding AssemblyName}" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/>-->
                    </Border>
                </Grid>

            </DataTemplate>

            <DataTemplate x:Key="Standard165x165ItemTemplate">
                <Grid HorizontalAlignment="Left" Width="147" Height="147">
                    <Border Background="{ThemeResource ControlExplorerIconBackgroundThemeBrush}">
                        <ContentControl ContentTemplate="{Binding Icon}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="28 16 28 40"/>
                    </Border>
                    <Border VerticalAlignment="Bottom" Height="34">
                        <TextBlock Text="{Binding Name}" Foreground="{ThemeResource ControlExplorerSimpleTextForegroundThemeBrush}" FontFamily="Segoe WP" FontSize="18" VerticalAlignment="Center" TextAlignment="Center"/>
                    </Border>
                </Grid>
            </DataTemplate>
            <DataTemplate x:Key="Standard125x125ItemTemplate">
                <Border Width="100" Height="100" Margin="0 0 1 1" Background="{ThemeResource ControlExplorerIconBackgroundThemeBrush}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ContentControl ContentTemplate="{Binding Icon}" Width="65" Height="45" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
                        <TextBlock Foreground="{ThemeResource ControlExplorerSimpleTextForegroundThemeBrush}" TextWrapping="Wrap" Margin="-20 0 -20 5" Text="{Binding Name}" HorizontalAlignment="Center" FontWeight="SemiLight" FontSize="14" Grid.Row="1"/>
                    </Grid>
                </Border>
            </DataTemplate>
            <DataTemplate x:Key="Standard100x100ItemTemplate">
                <Border Width="92" Height="92" Background="{ThemeResource ControlExplorerIconBackgroundThemeBrush}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ContentControl ContentTemplate="{Binding Icon}" Width="65" Height="45" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
                        <TextBlock Foreground="{ThemeResource ControlExplorerSimpleTextForegroundThemeBrush}" Style="{ThemeResource CaptionTextBlockStyle}"
                                   TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding Name}" HorizontalAlignment="Center" Grid.Row="1"/>
                    </Grid>
                </Border>
            </DataTemplate>

            <!-- List-appropriate 130 pixel high item template as seen in the SplitPage -->
            <DataTemplate x:Key="Standard130ItemTemplate">
                <Grid Margin="6">
                    <StackPanel VerticalAlignment="Top" Margin="10,5,10,5">
                        <TextBlock Text="{Binding Name}" Style="{StaticResource SubheaderTextStyle}" VerticalAlignment="Center" TextWrapping="NoWrap"/>
                    </StackPanel>
                </Grid>
            </DataTemplate>
            <DataTemplate x:Key="Standard80ItemTemplate">
                <Grid Margin="6">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="60" Height="60" Padding="5" VerticalAlignment="Top">
                        <ContentControl ContentTemplate="{Binding Icon}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
                    </Border>
                    <StackPanel Grid.Column="1" Margin="10,0,0,0">
                        <TextBlock Text="{Binding Name}" Style="{ThemeResource BodyTextBlockStyle}" MaxHeight="40"/>
                        <TextBlock Text="{Binding Description}" Style="{ThemeResource CaptionTextBlockStyle}" TextWrapping="WrapWholeWords"/>
                    </StackPanel>
                </Grid>
            </DataTemplate>

            <DataTemplate x:Key="Standard80WithIconItemTemplate">
                <Grid Margin="6">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <ContentControl ContentTemplate="{Binding Icon}"/>
                    <StackPanel Grid.Column="1" Margin="10,0,0,0">
                        <TextBlock Text="{Binding Name}" Style="{StaticResource ItemTextStyle}" MaxHeight="40"/>
                        <TextBlock Text="{Binding Description}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
                    </StackPanel>
                </Grid>
            </DataTemplate>

            <Style TargetType="GridView" x:Key="wideLayoutGridView">
                <Setter Property="Margin" Value="0" />
                <Setter Property="Padding" Value="40,40,40,44" />
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"></Setter>
                <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"></Setter>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"></Setter>
                <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled"></Setter>
                <Setter Property="ItemTemplate" Value="{StaticResource Standard165x165ItemTemplate}" />
                <Setter Property="ItemsPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <ItemsWrapGrid Orientation="Vertical" />
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="GridViewItem">
                            <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
                            <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="TabNavigation" Value="Local"/>
                            <Setter Property="IsHoldingEnabled" Value="True"/>
                            <Setter Property="Margin" Value="0 0 15 15" />
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="GridView" x:Key="narrowLayoutGridView">
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter>
                <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"></Setter>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter>
                <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"></Setter>
                <Setter Property="Margin" Value="2 0 2 0" />
                <Setter Property="ItemTemplate" Value="{StaticResource Standard125x125ItemTemplate}" />
                <Setter Property="ItemsPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <ItemsWrapGrid Orientation="Horizontal" MaximumRowsOrColumns="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="GridViewItem">
                            <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
                            <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="TabNavigation" Value="Local"/>
                            <Setter Property="IsHoldingEnabled" Value="True"/>
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>
