<Application x:Class="Showcase.WPF.DragDrop.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
             StartupUri="MainWindow.xaml">

    <Application.Resources>

        <ResourceDictionary>

            <SolidColorBrush x:Key="TabItemPanelBackgroundBrush" Color="Silver" />
            <SolidColorBrush x:Key="TabItemBackgroundIsSelectedBrush" Color="Gray" />
            <SolidColorBrush x:Key="TabItemBackgroundIsMouseOverBrush" Color="#A5A5A5" />
            <SolidColorBrush x:Key="TabItemForegroundIsSelectedBrush" Color="White" />
            <SolidColorBrush x:Key="TabItemSelectorBrush" Color="LawnGreen" />

            <Style x:Key="GitHubIssueButtonStyle"
                   x:Shared="False"
                   TargetType="{x:Type Button}">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Command" Value="{Binding OpenIssueCommand}" />
                <Setter Property="Content">
                    <Setter.Value>
                        <iconPacks:PackIconMaterial Width="24"
                                                    Height="24"
                                                    Kind="GithubCircle" />
                    </Setter.Value>
                </Setter>
                <Setter Property="Cursor" Value="Hand" />
                <Setter Property="HorizontalAlignment" Value="Right" />
                <Setter Property="HorizontalContentAlignment" Value="Center" />
                <Setter Property="Margin" Value="0 1 4 1" />
                <Setter Property="Padding" Value="1" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ButtonBase}">
                            <Grid Background="Transparent">
                                <Ellipse Fill="{TemplateBinding Background}" StrokeThickness="0" />
                                <ContentPresenter x:Name="PART_ContentPresenter"
                                                  Margin="{TemplateBinding Padding}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  RecognizesAccessKey="True"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Foreground" Value="#4078C0" />
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter Property="Foreground" Value="#315E95" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="VerticalContentAlignment" Value="Center" />
            </Style>

            <Style x:Key="GitHubPullRequestButtonStyle"
                   x:Shared="False"
                   BasedOn="{StaticResource GitHubIssueButtonStyle}"
                   TargetType="{x:Type Button}">
                <Setter Property="Command" Value="{Binding OpenPullRequestCommand}" />
            </Style>

            <Style x:Key="OpenLinkButtonStyle"
                   x:Shared="False"
                   BasedOn="{StaticResource GitHubIssueButtonStyle}"
                   TargetType="{x:Type Button}">
                <Setter Property="Command" Value="{Binding OpenLinkCommand}" />
                <Setter Property="Content">
                    <Setter.Value>
                        <iconPacks:PackIconFeatherIcons Width="20"
                                                        Height="20"
                                                        Kind="ExternalLink" />
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="DefaultTabItemStyle" TargetType="{x:Type TabItem}" />
            <Style x:Key="DefaultTabControlStyle" TargetType="{x:Type TabControl}">
                <Setter Property="Height" Value="100" />
                <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultTabItemStyle}" />
                <Setter Property="Margin" Value="4" />
                <Setter Property="TabStripPlacement" Value="Top" />
            </Style>

            <Style x:Key="ShowcaseTabItemStyle" TargetType="{x:Type TabItem}">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="Margin" Value="0" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid x:Name="PART_Grid"
                                  Margin="0"
                                  Background="{TemplateBinding Background}"
                                  SnapsToDevicePixels="True">
                                <TextBlock Name="PART_Text"
                                           Margin="0"
                                           Padding="10"
                                           VerticalAlignment="Center"
                                           FontSize="14"
                                           Text="{TemplateBinding Header}"
                                           TextTrimming="CharacterEllipsis"
                                           TextWrapping="NoWrap" />
                                <Rectangle x:Name="PART_Selector"
                                           Width="4"
                                           HorizontalAlignment="Left"
                                           Fill="{StaticResource TabItemSelectorBrush}"
                                           Visibility="Collapsed" />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Trigger.Setters>
                                        <Setter Property="Background" Value="{StaticResource TabItemBackgroundIsSelectedBrush}" />
                                        <Setter TargetName="PART_Text" Property="Foreground" Value="{StaticResource TabItemForegroundIsSelectedBrush}" />
                                        <Setter TargetName="PART_Selector" Property="Visibility" Value="Visible" />
                                    </Trigger.Setters>
                                </Trigger>
                                <Trigger SourceName="PART_Grid" Property="IsMouseOver" Value="True">
                                    <Trigger.Setters>
                                        <Setter Property="Background" Value="{StaticResource TabItemBackgroundIsMouseOverBrush}" />
                                    </Trigger.Setters>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Width" Value="120" />
            </Style>

            <Style x:Key="ShowcaseTabControlStyle" TargetType="{x:Type TabControl}">
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="ItemContainerStyle" Value="{StaticResource ShowcaseTabItemStyle}" />
                <Setter Property="Margin" Value="0" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="TabStripPlacement" Value="Left" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabControl}">
                            <DockPanel LastChildFill="True">
                                <WrapPanel x:Name="HeaderPanel"
                                           Panel.ZIndex="1"
                                           Background="{StaticResource TabItemPanelBackgroundBrush}"
                                           DockPanel.Dock="Left"
                                           IsItemsHost="True"
                                           KeyboardNavigation.TabIndex="1"
                                           Orientation="Vertical" />
                                <Border x:Name="ContentPanel"
                                        Background="{TemplateBinding Background}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        KeyboardNavigation.DirectionalNavigation="Contained"
                                        KeyboardNavigation.TabIndex="2"
                                        KeyboardNavigation.TabNavigation="Local"
                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                    <ContentPresenter x:Name="PART_SelectedContentHost"
                                                      Margin="{TemplateBinding Padding}"
                                                      ContentSource="SelectedContent"
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                </Border>
                            </DockPanel>
                            <ControlTemplate.Triggers>
                                <Trigger Property="TabStripPlacement" Value="Top">
                                    <Setter TargetName="HeaderPanel" Property="DockPanel.Dock" Value="Top" />
                                    <Setter TargetName="HeaderPanel" Property="Orientation" Value="Horizontal" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="DefaultTextBlockStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="14" />
                <Setter Property="Margin" Value="4" />
                <Setter Property="TextWrapping" Value="Wrap" />
            </Style>

            <Style x:Key="SampleHeaderTextBlockStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="Background" Value="Gainsboro" />
                <Setter Property="FontSize" Value="14" />
                <Setter Property="Foreground" Value="Gray" />
                <Setter Property="Padding" Value="10" />
            </Style>

            <Style x:Key="DefaultListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
                <Setter Property="Padding" Value="2" />
            </Style>
            <Style BasedOn="{StaticResource DefaultListBoxItemStyle}" TargetType="{x:Type ListBoxItem}" />

            <Style x:Key="DefaultListBoxStyle" TargetType="{x:Type ListBox}">
                <Setter Property="Height" Value="300" />
                <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultListBoxItemStyle}" />
                <Setter Property="Margin" Value="4" />
                <Setter Property="SelectionMode" Value="Extended" />
            </Style>

            <Style x:Key="DefaultItemsControl" TargetType="{x:Type ItemsControl}">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="BorderBrush" Value="#FF888888" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Height" Value="300" />
                <Setter Property="Margin" Value="4" />
            </Style>

            <Style x:Key="DefaultListViewItemStyle" TargetType="{x:Type ListViewItem}">
                <Setter Property="Padding" Value="2" />
            </Style>
            <Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="{x:Type ListViewItem}" />

            <Style x:Key="DefaultListViewStyle" TargetType="{x:Type ListView}">
                <Setter Property="Height" Value="300" />
                <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultListViewItemStyle}" />
                <Setter Property="Margin" Value="4" />
                <Setter Property="SelectionMode" Value="Extended" />
            </Style>

            <Style x:Key="DefaultTreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Margin="2" Text="{Binding}" />
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Padding" Value="2" />
            </Style>
            <Style BasedOn="{StaticResource DefaultTreeViewItemStyle}" TargetType="{x:Type TreeViewItem}" />

            <Style x:Key="DefaultTreeViewStyle" TargetType="{x:Type TreeView}">
                <Setter Property="Height" Value="300" />
                <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultTreeViewItemStyle}" />
                <Setter Property="Margin" Value="4" />
            </Style>

            <Style x:Key="DefaultDataGridStyle" TargetType="{x:Type DataGrid}">
                <Setter Property="Height" Value="300" />
                <Setter Property="HorizontalGridLinesBrush" Value="Silver" />
                <Setter Property="Margin" Value="4" />
                <Setter Property="SelectionMode" Value="Extended" />
                <Setter Property="VerticalGridLinesBrush" Value="Silver" />
            </Style>

        </ResourceDictionary>

    </Application.Resources>

</Application>