<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:project="clr-namespace:Project_Interactivity_Triggers"
  xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  xmlns:noesis="clr-namespace:NoesisGUIExtensions"
  mc:Ignorable="d">
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="ResourceDictionaries/CompanionArtwork_ResourceDictionary.xaml"/>
  </ResourceDictionary.MergedDictionaries>
  <DataTemplate x:Key="PlayerProfile_ContentControl_Content_Template" DataType="String">
    <Grid x:Name="Master_Grid">
      <Viewbox x:Name="Avatar_Viewbox" Height="{Binding Path=ActualHeight, RelativeSource={RelativeSource TemplatedParent}}">
        <Grid x:Name="Avatar_Grid">
          <Ellipse x:Name="Avatar_Ellipse" Margin="1,1,1,1">
            <Ellipse.Fill>
              <ImageBrush ImageSource="Assets/AvatarImage.png" Stretch="UniformToFill"/>
            </Ellipse.Fill>
          </Ellipse>
          <Ellipse x:Name="Outline_Ellipse" Width="32" StrokeThickness="2" Height="32">
            <Ellipse.Stroke>
              <SolidColorBrush Color="{DynamicResource Base_1}"/>
            </Ellipse.Stroke>
          </Ellipse>
        </Grid>
      </Viewbox>
    </Grid>
  </DataTemplate>
  <DataTemplate x:Key="CharacterTile_ListBox_Item_Template">
    <Grid x:Name="Master_Grid">
      <Grid x:Name="Background_Grid">
        <Border x:Name="Background_Border" Opacity="0.5" CornerRadius="64,64,64,64">
          <Border.Background>
            <SolidColorBrush Color="{DynamicResource Base_1}"/>
          </Border.Background>
        </Border>
        <Grid x:Name="CharacterPortrait_BottomFade">
          <Grid.OpacityMask>
            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
              <GradientStop Color="#00000000" Offset="0.95"/>
              <GradientStop Offset="0" Color="#FF000000"/>
            </LinearGradientBrush>
          </Grid.OpacityMask>
          <Border x:Name="CharacterPortrait_Border" Margin="0,16,0,0" CornerRadius="64,64,64,64">
            <Border.Background>
              <ImageBrush ImageSource="{Binding Path=CharacterPortrait}" Stretch="UniformToFill"/>
            </Border.Background>
          </Border>
        </Grid>
      </Grid>
      <Grid x:Name="Layout_Grid" Margin="32,32,32,32">
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid x:Name="OwnershipStatus_Grid" Margin="0,0,0,8" Row="1" HorizontalAlignment="Left">
          <Grid.Visibility>
            <Binding Path="IsOwned">
              <Binding.Converter>
                <BooleanToVisibilityConverter/>
              </Binding.Converter>
            </Binding>
          </Grid.Visibility>
          <Border x:Name="OwnershipFrame_Border" Padding="12,8,12,6" CornerRadius="16,16,16,16">
            <Border.Background>
              <SolidColorBrush Color="{DynamicResource Allternate_1}"/>
            </Border.Background>
            <TextBlock Text="OWNED" Grid.Row="3" FontFamily="Tw Cen MT" FontSize="24" FontWeight="Bold" TextWrapping="Wrap">
              <TextBlock.Foreground>
                <SolidColorBrush Color="{DynamicResource Base_2}"/>
              </TextBlock.Foreground>
            </TextBlock>
          </Border>
        </Grid>
        <TextBlock Text="{Binding Path=CharacterName}" Grid.Row="2" FontFamily="Tw Cen MT" FontSize="64" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_2}"/>
          </TextBlock.Foreground>
        </TextBlock>
        <TextBlock Text="{Binding Path=CharacterClass}" Grid.Row="3" FontFamily="Tw Cen MT" FontSize="32" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </TextBlock.Foreground>
        </TextBlock>
      </Grid>
    </Grid>
  </DataTemplate>
  <DataTemplate x:Key="StatsPanel_ContentControl_Content_Template">
    <Grid x:Name="Master_Grid" Margin="16,16,0,16">
      <Grid x:Name="Background_Grid">
        <Border x:Name="Background_Border" Opacity="0.5" CornerRadius="{DynamicResource TileRadius_1_CornerRadius}">
          <Border.Background>
            <SolidColorBrush Color="{DynamicResource Base_1}"/>
          </Border.Background>
        </Border>
      </Grid>
      <Grid x:Name="InnerLayout_Grid" Margin="32">
        <Grid.RowDefinitions>
          <RowDefinition Height="1*"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel x:Name="InnerLayout_VerticalStackPanel">
          <StackPanel x:Name="TextContent_VerticalStackPanel">
            <TextBlock Text="{Binding Path=CharacterName}" FontFamily="Tw Cen MT" FontSize="64" TextWrapping="Wrap">
              <TextBlock.Foreground>
                <SolidColorBrush Color="{DynamicResource Primary_2}"/>
              </TextBlock.Foreground>
            </TextBlock>
            <TextBlock Text="{Binding Path=CharacterClass}" FontFamily="Tw Cen MT" FontSize="32" TextWrapping="Wrap">
              <TextBlock.Foreground>
                <SolidColorBrush Color="{DynamicResource Primary_1}"/>
              </TextBlock.Foreground>
            </TextBlock>
            <TextBlock Text="{Binding Path=CharacterDescription}" Padding="0,16,0,0" FontFamily="Tw Cen MT" FontSize="24" TextWrapping="Wrap">
              <TextBlock.Foreground>
                <SolidColorBrush Color="{DynamicResource Primary_3}"/>
              </TextBlock.Foreground>
            </TextBlock>
          </StackPanel>
          <StackPanel x:Name="SkillBars_VerticalStackPanel">
            <ContentControl Content="{Binding Path=CharacterSkills[0]}" ContentTemplate="{DynamicResource CharacterStat_ContentControl_Content_Template}"/>
            <ContentControl Content="{Binding Path=CharacterSkills[1]}" ContentTemplate="{DynamicResource CharacterStat_ContentControl_Content_Template}"/>
            <ContentControl Content="{Binding Path=CharacterSkills[2]}" ContentTemplate="{DynamicResource CharacterStat_ContentControl_Content_Template}"/>
          </StackPanel>
          <ContentControl x:Name="CompanionInfo_ContentControl" Content="{Binding Path=Companion}" ContentTemplate="{DynamicResource CompanionInfo_ContentControl_Content_Template}"/>
        </StackPanel>
        <CheckBox x:Name="Purchase_CheckBox" Content="{Binding Path=CharacterCost}" IsChecked="{Binding Path=IsOwned, Mode=TwoWay}" Grid.Row="1" Template="{DynamicResource PurchaseButton_CheckBox_Template}">
          <b:Interaction.Triggers>
            <b:DataTrigger x:Name="IfItemNotOwned_PurchaseAvailable" Binding="{Binding Path=IsOwned}" Value="False">
              <b:ChangePropertyAction TargetName="Purchase_CheckBox" PropertyName="IsChecked" Value="False"/>
            </b:DataTrigger>
            <b:DataTrigger x:Name="IfItemOwned_PurchaseUnavailable" Binding="{Binding Path=IsOwned}" Value="True">
              <b:ChangePropertyAction TargetName="Purchase_CheckBox" PropertyName="IsChecked" Value="True"/>
            </b:DataTrigger>
          </b:Interaction.Triggers>
        </CheckBox>
      </Grid>
    </Grid>
  </DataTemplate>
  <ItemsPanelTemplate x:Key="CharacterGrid_ListBox_ItemsPanel_Template">
    <UniformGrid Columns="4" Rows="2"/>
  </ItemsPanelTemplate>
  <Style x:Key="CharacterTile_ListBox_ItemContainer_Style" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
    <Setter Property="Template" Value="{DynamicResource CharacterTile_ListBox_ItemContainer_Template}"/>
    <Setter Property="FocusVisualStyle" Value="{DynamicResource CharacterTile_ListBox_ItemContainer_Style}"/>
  </Style>
  <ControlTemplate x:Key="CharacterTile_ListBox_ItemContainer_Template" TargetType="ListBoxItem">
    <Grid x:Name="Master_Grid" RenderTransformOrigin="0.5,0.5" Margin="16,16,16,16" Cursor="Hand">
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
          <VisualStateGroup.Transitions>
            <VisualTransition GeneratedDuration="00:00:00.2500000"/>
          </VisualStateGroup.Transitions>
          <VisualState x:Name="Normal"/>
          <VisualState x:Name="MouseOver">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Master_Grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1.05"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomGlow_Hover_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="OuterGlow_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Disabled"/>
        </VisualStateGroup>
        <VisualStateGroup x:Name="FocusStates">
          <VisualStateGroup.Transitions>
            <VisualTransition GeneratedDuration="00:00:00"/>
          </VisualStateGroup.Transitions>
          <VisualState x:Name="Unfocused"/>
          <VisualState x:Name="Focused">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Outline_Border" Storyboard.TargetProperty="(Border.BorderBrush).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomGlow_Focused_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
        </VisualStateGroup>
        <VisualStateGroup x:Name="SelectionStates">
          <VisualState x:Name="Unselected"/>
          <VisualState x:Name="Selected">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Outline_Border" Storyboard.TargetProperty="(Border.BorderBrush).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomGlow_Focused_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="SelectedUnfocused">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Outline_Border" Storyboard.TargetProperty="(Border.BorderBrush).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomGlow_Focused_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Grid.RenderTransform>
        <TransformGroup>
          <ScaleTransform ScaleY="{Binding Path=ScaleX, RelativeSource={RelativeSource Self}}"/>
          <SkewTransform/>
          <RotateTransform/>
          <TranslateTransform/>
        </TransformGroup>
      </Grid.RenderTransform>
      <Border x:Name="OuterGlow_Border" Opacity="0" CornerRadius="{DynamicResource TileRadius_1_CornerRadius}" BlendingMode="Screen">
        <Border.Effect>
          <DropShadowEffect Color="{DynamicResource Primary_1}" BlurRadius="128" Direction="90" ShadowDepth="8" Opacity="0.097"/>
        </Border.Effect>
        <Border.Background>
          <SolidColorBrush Color="#FF000000"/>
        </Border.Background>
      </Border>
      <Border x:Name="BottomGlow_Hover_Border" Opacity="0" CornerRadius="{DynamicResource TileRadius_1_CornerRadius}">
        <Border.BorderBrush>
          <SolidColorBrush Opacity="0" Color="{DynamicResource Primary_1}"/>
        </Border.BorderBrush>
        <Border.Background>
          <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity="0.25">
            <GradientStop Offset="0"/>
            <GradientStop Offset="1" Color="{DynamicResource Primary_1}"/>
          </LinearGradientBrush>
        </Border.Background>
      </Border>
      <Border x:Name="BottomGlow_Focused_Border" Opacity="0" CornerRadius="{DynamicResource TileRadius_1_CornerRadius}">
        <Border.BorderBrush>
          <SolidColorBrush Opacity="0" Color="{DynamicResource Primary_1}"/>
        </Border.BorderBrush>
        <Border.Background>
          <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity="0.25">
            <GradientStop Offset="0"/>
            <GradientStop Offset="1" Color="{DynamicResource Primary_1}"/>
          </LinearGradientBrush>
        </Border.Background>
      </Border>
      <ContentPresenter/>
      <Border x:Name="Outline_Border" BorderThickness="2,2,2,2" CornerRadius="{DynamicResource TileRadius_1_CornerRadius}">
        <Border.BorderBrush>
          <SolidColorBrush Opacity="0" Color="{DynamicResource Primary_1}"/>
        </Border.BorderBrush>
      </Border>
    </Grid>
  </ControlTemplate>
  <CornerRadius x:Key="TileRadius_1_CornerRadius">64,64,64,64</CornerRadius>
  <Color x:Key="Primary_1">#FFFF89B1</Color>
  <Color x:Key="Primary_2">#FFF1DFFD</Color>
  <Color x:Key="Primary_3">#b5a5c1</Color>
  <Color x:Key="Allternate_1">#FF00E1FB</Color>
  <Color x:Key="Base_1">#FF20142D</Color>
  <Color x:Key="Base_2">#FF10081A</Color>
  <Color x:Key="Base_3">#FF13091E</Color>
  <DataTemplate x:Key="CharacterStat_ContentControl_Content_Template" DataType="String">
    <Grid x:Name="Master_Grid" Margin="0,16,0,16">
      <StackPanel x:Name="VerticalStackPanel">
        <Grid x:Name="ProgressBar_Labels_Grid" Margin="0,0,0,4">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
          </Grid.ColumnDefinitions>
          <TextBlock x:Name="SkillName_TextBlock" Text="{Binding Path=Skill_Name}" FontFamily="Tw Cen MT" FontSize="24">
            <TextBlock.Foreground>
              <SolidColorBrush Color="{DynamicResource Primary_3}"/>
            </TextBlock.Foreground>
          </TextBlock>
          <TextBlock x:Name="SkillNumber_TextBlock" Text="{Binding Path=Skill_Number}" Grid.Column="1" FontFamily="Tw Cen MT" FontSize="24" TextAlignment="Right">
            <TextBlock.Foreground>
              <SolidColorBrush Color="{DynamicResource Primary_1}"/>
            </TextBlock.Foreground>
          </TextBlock>
        </Grid>
        <ProgressBar x:Name="SkillBar_ProgressBar" Value="{Binding Path=Skill_Number}" Template="{DynamicResource Skill_ProgressBar_Template}">
          <ProgressBar.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </ProgressBar.Foreground>
          <b:Interaction.Triggers>
            <b:DataTrigger x:Name="IfSkillAbove75_SpecialColor" Binding="{Binding Path=Value, ElementName=SkillBar_ProgressBar}" Comparison="GreaterThanOrEqual" Value="75">
              <b:ChangePropertyAction TargetName="SkillNumber_TextBlock" PropertyName="Foreground" Value="#FF00E1FB"/>
              <b:ChangePropertyAction TargetName="SkillBar_ProgressBar" PropertyName="Foreground" Value="#FF00E1FB"/>
            </b:DataTrigger>
          </b:Interaction.Triggers>
        </ProgressBar>
      </StackPanel>
    </Grid>
  </DataTemplate>
  <ControlTemplate x:Key="Skill_ProgressBar_Template" TargetType="ProgressBar">
    <Grid>
      <Border x:Name="PART_Track" Height="16" Opacity="0.05" CornerRadius="8,8,8,8">
        <Border.Background>
          <SolidColorBrush Color="{DynamicResource Primary_2}"/>
        </Border.Background>
      </Border>
      <Border x:Name="PART_Indicator" HorizontalAlignment="Left" Background="{Binding Path=Foreground, RelativeSource={RelativeSource TemplatedParent}}" CornerRadius="8,8,8,8"/>
    </Grid>
  </ControlTemplate>
  <ControlTemplate x:Key="Purchase_Button_Template" TargetType="Button">
    <Grid x:Name="Master_Grid" Cursor="Hand">
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
          <VisualState x:Name="Normal"/>
          <VisualState x:Name="MouseOver">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Cost_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Primary_1}"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Pressed"/>
          <VisualState x:Name="Disabled"/>
        </VisualStateGroup>
        <VisualStateGroup x:Name="PurchaseStates">
          <VisualState x:Name="Owned">
            <Storyboard>
              <StringAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextBlock.Text)">
                <DiscreteStringKeyFrame KeyTime="00:00:00" Value="OWNED"/>
              </StringAnimationUsingKeyFrames>
              <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Cost_TextBlock" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}"/>
              </ObjectAnimationUsingKeyFrames>
              <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextBlock.TextAlignment)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static TextAlignment.Center}"/>
              </ObjectAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetName="Master_Grid" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
              </BooleanAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="NotOwned"/>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <b:Interaction.Triggers>
        <b:DataTrigger x:Name="IfNotOwned_EnablePurchase" Binding="{Binding Path=IsOwned}" Value="False">
          <b:GoToStateAction StateName="NotOwned"/>
        </b:DataTrigger>
        <b:DataTrigger x:Name="IfOwned_DisablePurchase" Binding="{Binding Path=IsOwned}" Value="True">
          <b:GoToStateAction StateName="Owned"/>
        </b:DataTrigger>
      </b:Interaction.Triggers>
      <Border x:Name="Backer_Border" CornerRadius="16,16,16,16">
        <Border.Background>
          <SolidColorBrush Color="{DynamicResource Primary_2}" Opacity="0.05"/>
        </Border.Background>
      </Border>
      <Grid x:Name="Content_Grid" Margin="16,16,16,16">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="1*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock x:Name="Purchase_TextBlock" Text="PURCHASE" FontFamily="Tw Cen MT" FontSize="24" FontWeight="Bold" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </TextBlock.Foreground>
        </TextBlock>
        <TextBlock x:Name="Cost_TextBlock" Grid.Column="1" FontFamily="Tw Cen MT" FontSize="24" FontWeight="Bold" FontStyle="Italic" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </TextBlock.Foreground>
          <Run Text="{Binding Path=CharacterCost}"/><Run Text=" CR"/>
        </TextBlock>
      </Grid>
    </Grid>
  </ControlTemplate>
  <ControlTemplate x:Key="PurchaseButton_CheckBox_Template" TargetType="CheckBox">
    <Grid x:Name="Master_Grid" Cursor="Hand">
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
          <VisualState x:Name="Normal"/>
          <VisualState x:Name="MouseOver">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Cost_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Primary_1}"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Pressed"/>
          <VisualState x:Name="Disabled"/>
        </VisualStateGroup>
        <VisualStateGroup x:Name="CheckStates">
          <VisualState x:Name="Unchecked"/>
          <VisualState x:Name="Checked">
            <Storyboard>
              <StringAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextBlock.Text)">
                <DiscreteStringKeyFrame KeyTime="00:00:00" Value="RECRUITED"/>
              </StringAnimationUsingKeyFrames>
              <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Cost_TextBlock" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}"/>
              </ObjectAnimationUsingKeyFrames>
              <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextBlock.TextAlignment)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static TextAlignment.Center}"/>
              </ObjectAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
              </BooleanAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetName="Master_Grid" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
              </BooleanAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Allternate_1}"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Indeterminate"/>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Border x:Name="Backer_Border" CornerRadius="16,16,16,16">
        <Border.Background>
          <SolidColorBrush Color="{DynamicResource Primary_2}" Opacity="0.05"/>
        </Border.Background>
      </Border>
      <Grid x:Name="Content_Grid" Margin="16,16,16,16">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="1*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock x:Name="Purchase_TextBlock" Text="RECRUIT" FontFamily="Tw Cen MT" FontSize="24" FontWeight="Bold" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </TextBlock.Foreground>
        </TextBlock>
        <TextBlock x:Name="Cost_TextBlock" Grid.Column="1" FontFamily="Tw Cen MT" FontSize="24" FontWeight="Bold" FontStyle="Italic" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </TextBlock.Foreground>
          <Run Text="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}"/><Run Text=" CR"/>
        </TextBlock>
      </Grid>
    </Grid>
  </ControlTemplate>
  <ControlTemplate x:Key="NavButton_Button_Template" TargetType="Button">
    <Grid x:Name="Master_Grid" Cursor="Hand">
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
          <VisualState x:Name="Normal"/>
          <VisualState x:Name="MouseOver">
            <Storyboard>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Cost_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Purchase_TextBlock" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Base_1}"/>
              </ColorAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                <LinearColorKeyFrame KeyTime="00:00:00" Value="{DynamicResource Primary_1}"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Backer_Border" Storyboard.TargetProperty="(Panel.Background).(Brush.Opacity)">
                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Pressed"/>
          <VisualState x:Name="Disabled"/>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Border x:Name="Backer_Border" CornerRadius="16,16,16,16">
        <Border.Background>
          <SolidColorBrush Color="{DynamicResource Primary_2}" Opacity="0.05"/>
        </Border.Background>
      </Border>
      <Grid x:Name="Content_Grid" Margin="16,16,16,16">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="1*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock x:Name="Purchase_TextBlock" FontFamily="Tw Cen MT" FontSize="24" FontWeight="Bold" TextWrapping="Wrap">
          <TextBlock.Foreground>
            <SolidColorBrush Color="{DynamicResource Primary_1}"/>
          </TextBlock.Foreground>
          <TextBlock.Text>
            <Binding Path="Content" RelativeSource="{RelativeSource Mode=TemplatedParent}">
              <Binding.Converter>
                <noesis:CaseConverter/>
              </Binding.Converter>
            </Binding>
          </TextBlock.Text>
        </TextBlock>
      </Grid>
    </Grid>
  </ControlTemplate>
  <DataTemplate x:Key="CompanionInfo_ContentControl_Content_Template">
    <Grid x:Name="Master_Grid" Margin="0,16">
      <Border x:Name="Backer_Border" CornerRadius="16,16,16,16">
        <Border.Background>
          <SolidColorBrush Color="{DynamicResource Primary_2}" Opacity="0.05"/>
        </Border.Background>
      </Border>
      <Grid x:Name="ContentLayout_Grid" Margin="24">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <ContentControl x:Name="CompanionArtwork_ContentControl" Content="ContentControl" Height="64" ContentTemplate="{DynamicResource CompanionArtwork_1_ContentControl_Content_Template}">
          <b:Interaction.Triggers>
            <b:DataTrigger x:Name="IfEnum=Companion_1_ShowCompanion_1_Artwork" Value="Companion_1" Binding="{Binding Path=CompanionArtwork}">
              <b:ChangePropertyAction TargetName="CompanionArtwork_ContentControl" PropertyName="ContentTemplate" Value="{DynamicResource CompanionArtwork_1_ContentControl_Content_Template}"/>
            </b:DataTrigger>
            <b:DataTrigger x:Name="IfEnum=Companion_2_ShowCompanion_2_Artwork" Value="Companion_2" Binding="{Binding Path=CompanionArtwork}">
              <b:ChangePropertyAction TargetName="CompanionArtwork_ContentControl" PropertyName="ContentTemplate" Value="{DynamicResource CompanionArtwork_2_ContentControl_Content_Template}"/>
            </b:DataTrigger>
            <b:DataTrigger x:Name="IfEnum=Companion_3_ShowCompanion_3_Artwork" Binding="{Binding Path=CompanionArtwork}" Value="Companion_3">
              <b:ChangePropertyAction TargetName="CompanionArtwork_ContentControl" PropertyName="ContentTemplate" Value="{DynamicResource CompanionArtwork_3_ContentControl_Content_Template}"/>
            </b:DataTrigger>
          </b:Interaction.Triggers>
        </ContentControl>
        <StackPanel x:Name="CompanionText_VerticalStackPanel" Margin="24,0" Grid.Column="1" VerticalAlignment="Center">
          <TextBlock Text="{Binding Path=CompanionName}" FontFamily="Tw Cen MT" FontSize="20">
            <TextBlock.Foreground>
              <SolidColorBrush Color="{DynamicResource Primary_2}"/>
            </TextBlock.Foreground>
          </TextBlock>
          <TextBlock Text="{Binding Path=CompanionDescription}" Margin="0,4,0,0" TextWrapping="Wrap">
            <TextBlock.Foreground>
              <SolidColorBrush Color="{DynamicResource Primary_3}"/>
            </TextBlock.Foreground>
          </TextBlock>
        </StackPanel>
      </Grid>
    </Grid>
  </DataTemplate>
</ResourceDictionary>