Themes/Generic.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"
                    xmlns:local="clr-namespace:MaterialDesignThemes.Wpf"
                    xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:transitions="clr-namespace:MaterialDesignThemes.Wpf.Transitions">
 
  <ResourceDictionary.MergedDictionaries>
    <!--
      we only bring in the dictionaries for controls which were "invented"
      as part of Material Design in XAML Toolkit. Other themes, for existing controls
      must be selected manually by the user, so that they override default styles.
      The easiest way to do this is include:
 
      MaterialDesignTheme.Defaults.xaml
      in your App.xaml
    -->
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Badged.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Card.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Chip.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Clock.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Flipper.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.FlipperClassic.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ColorPicker.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.NumericUpDown.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RatingBar.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.SmartHint.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Snackbar.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.AutoSuggestBox.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.SplitButton.xaml" />
  </ResourceDictionary.MergedDictionaries>
 
  <!-- set up default styles for our custom Material Design in XAML Toolkit controls -->
  <Style TargetType="{x:Type local:Clock}" BasedOn="{StaticResource MaterialDesignClock}" />
  <Style TargetType="{x:Type local:Badged}" BasedOn="{StaticResource MaterialDesignBadge}" />
  <Style TargetType="{x:Type local:Card}" BasedOn="{StaticResource MaterialDesignElevatedCard}" />
  <Style TargetType="{x:Type local:PopupBox}" BasedOn="{StaticResource MaterialDesignPopupBox}" />
  <Style TargetType="{x:Type local:TimePicker}" BasedOn="{StaticResource MaterialDesignTimePicker}" />
  <Style TargetType="{x:Type local:AutoSuggestBox}" BasedOn="{StaticResource MaterialDesignAutoSuggestBox}" />
  <Style TargetType="{x:Type local:SplitButton}" BasedOn="{StaticResource MaterialDesignRaisedSplitButton}" />
  <Style TargetType="{x:Type local:NumericUpDown}" BasedOn="{StaticResource MaterialDesignNumericUpDown}" />
  <Style TargetType="{x:Type local:DecimalUpDown}" BasedOn="{StaticResource MaterialDesignNumericUpDown}" />
 
  <system:Boolean x:Key="True">True</system:Boolean>
 
  <Style TargetType="{x:Type local:Ripple}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="ClipToBounds" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:RippleAssist.ClipToBounds)}" />
    <Setter Property="Feedback" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:RippleAssist.Feedback)}" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="RecognizesAccessKey" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:Ripple}">
          <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Normal" To="MousePressed">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleX">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleY">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ClickEllipse" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value=".26" />
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="MousePressed" To="MouseOut">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleX">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.12" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleY">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.12" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseIn" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ClickEllipse" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.12" Value="0" />
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="MousePressed" To="Normal">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleX">
                        <EasingDoubleKeyFrame x:Name="MousePressedToNormalScaleXKeyFrame"
                                              KeyTime="0:0:0.30"
                                              Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="0" />
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleY">
                        <EasingDoubleKeyFrame x:Name="MousePressedToNormalScaleYKeyFrame"
                                              KeyTime="0:0:0.30"
                                              Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="0" />
                      </DoubleAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ClickEllipse" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value=".26" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.30" Value=".26" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.50" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Normal">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     To="0" />
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleY"
                                     To="0" />
                    <DoubleAnimation Storyboard.TargetName="ClickEllipse"
                                     Storyboard.TargetProperty="Opacity"
                                     To="0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MousePressed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     To="1" />
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleY"
                                     To="1" />
                    <DoubleAnimation Storyboard.TargetName="ClickEllipse"
                                     Storyboard.TargetProperty="Opacity"
                                     To="0.26" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="MouseOut">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     To="0" />
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleY"
                                     To="0" />
                    <DoubleAnimation Storyboard.TargetName="ClickEllipse"
                                     Storyboard.TargetProperty="Opacity"
                                     To="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Canvas HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    IsHitTestVisible="False">
              <Ellipse x:Name="ClickEllipse"
                       Canvas.Left="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleX}"
                       Canvas.Top="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleY}"
                       Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleSize}"
                       Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RippleSize}"
                       Fill="{TemplateBinding Feedback}"
                       Opacity="0"
                       RenderTransformOrigin=".5,.5">
                <Ellipse.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform x:Name="ScaleTransform" ScaleX="0" ScaleY="0" />
                    <SkewTransform />
                    <RotateTransform />
                    <TranslateTransform x:Name="TranslateTransform" />
                  </TransformGroup>
                </Ellipse.RenderTransform>
              </Ellipse>
              <Canvas.Style>
                <Style TargetType="Canvas">
                  <Setter Property="ZIndex" Value="0" />
                  <Style.Triggers>
                    <Trigger Property="local:RippleAssist.RippleOnTop" Value="True">
                      <Setter Property="ZIndex" Value="2" />
                    </Trigger>
                  </Style.Triggers>
                </Style>
              </Canvas.Style>
            </Canvas>
            <ContentPresenter Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              Panel.ZIndex="1"
                              Content="{TemplateBinding Content}"
                              ContentStringFormat="{TemplateBinding ContentStringFormat}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                              RecognizesAccessKey="{TemplateBinding RecognizesAccessKey}"
                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="VerticalAlignment" Value="Stretch" />
  </Style>
 
  <Style TargetType="{x:Type local:Underline}">
    <Setter Property="Background" Value="{Binding Path=(local:TextFieldAssist.UnderlineBrush), RelativeSource={RelativeSource Self}}" />
    <Setter Property="Height" Value="2" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:Underline}">
          <ControlTemplate.Resources>
            <CircleEase x:Key="UnderlineEasingFunction" EasingMode="EaseOut" />
          </ControlTemplate.Resources>
          <Border x:Name="UnderlineBorder"
                  Height="{TemplateBinding Height}"
                  HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                  VerticalAlignment="{TemplateBinding VerticalAlignment}"
                  Background="{TemplateBinding Background}"
                  CornerRadius="{TemplateBinding CornerRadius}"
                  IsHitTestVisible="False"
                  RenderTransformOrigin="0.5,0.5"
                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Border.RenderTransform>
              <ScaleTransform x:Name="ScaleTransform" ScaleX="0" ScaleY="1" />
            </Border.RenderTransform>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ActivationStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Inactive" To="Active">
                    <Storyboard>
                      <DoubleAnimation EasingFunction="{StaticResource UnderlineEasingFunction}"
                                       Storyboard.TargetName="ScaleTransform"
                                       Storyboard.TargetProperty="ScaleX"
                                       To="1"
                                       Duration="0:0:0.3" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Active" To="Inactive">
                    <Storyboard>
                      <DoubleAnimation EasingFunction="{StaticResource UnderlineEasingFunction}"
                                       Storyboard.TargetName="ScaleTransform"
                                       Storyboard.TargetProperty="ScaleX"
                                       To="0"
                                       Duration="0:0:0.3" />
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Active">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     To="1"
                                     Duration="0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Inactive">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="ScaleTransform"
                                     Storyboard.TargetProperty="ScaleX"
                                     To="0"
                                     Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="VerticalAlignment" Value="Bottom" />
    <Setter Property="local:TextFieldAssist.UnderlineBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
  </Style>
 
  <Style TargetType="{x:Type local:MaterialDateDisplay}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:MaterialDateDisplay}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <StackPanel Margin="0" Orientation="Vertical">
              <TextBlock x:Name="ComponentThreeTextBlock"
                         HorizontalAlignment="Left"
                         FontSize="15"
                         FontWeight="Normal"
                         Text="{TemplateBinding ComponentThreeContent}" />
              <StackPanel x:Name="ComponentOneTwoWrapper"
                          HorizontalAlignment="Left"
                          Orientation="Horizontal">
                <TextBlock Margin="0,0,10,0"
                           FontSize="30"
                           FontWeight="Normal"
                           Text="{TemplateBinding ComponentTwoContent}" />
                <TextBlock FontSize="30"
                           FontWeight="Normal"
                           Text="{TemplateBinding ComponentOneContent}" />
              </StackPanel>
            </StackPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDayInFirstComponent" Value="True">
              <Setter TargetName="ComponentThreeTextBlock" Property="Opacity" Value=".56" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="ComponentOneTwoWrapper" Property="Opacity" Value=".56" />
              <Setter TargetName="ComponentThreeTextBlock" Property="Opacity" Value="1" />
            </Trigger>
            <Trigger Property="local:CalendarAssist.Orientation" Value="Horizontal">
              <Setter TargetName="ComponentOneTwoWrapper" Property="Orientation" Value="Vertical" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
 
  <Style TargetType="{x:Type local:ListSortDirectionIndicator}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:ListSortDirectionIndicator}">
          <Viewbox Margin="0,0,0,0">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="Direction">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0"
                                    From="None"
                                    To="Descending">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut" />
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                       To="1"
                                       Duration="0:0:0.2" />
                      <DoubleAnimation BeginTime="0:0:0.2"
                                       Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
                                       To="90"
                                       Duration="0:0:0.2" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0"
                                    From="None"
                                    To="Ascending">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut" />
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                       To="1"
                                       Duration="0:0:0.2" />
                      <DoubleAnimation BeginTime="0:0:0.2"
                                       Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
                                       To="-90"
                                       Duration="0:0:0.2">
                        <DoubleAnimation.EasingFunction>
                          <CubicEase EasingMode="EaseOut" />
                        </DoubleAnimation.EasingFunction>
                      </DoubleAnimation>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0"
                                    From="Descending"
                                    To="Ascending">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut" />
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                       To="1"
                                       Duration="0">
                        <DoubleAnimation.EasingFunction>
                          <CubicEase EasingMode="EaseOut" />
                        </DoubleAnimation.EasingFunction>
                      </DoubleAnimation>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
                                       From="90"
                                       To="-90"
                                       Duration="0:0:0.2" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0"
                                    From="Descending"
                                    To="None">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut" />
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                       To="0"
                                       Duration="0:0:0.2" />
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
                                       To="90"
                                       Duration="0" />
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0"
                                    From="Ascending"
                                    To="Descending">
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
                                       From="-90"
                                       To="90"
                                       Duration="0:0:0.2" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0"
                                    From="Ascending"
                                    To="None">
                    <Storyboard>
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
                                       To="-90"
                                       Duration="0" />
                      <DoubleAnimation Storyboard.TargetName="path"
                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                       To="0"
                                       Duration="0:0:0.2" />
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="None">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Descending">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="90" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Ascending">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="-90" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                      <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Path x:Name="path"
                  Width="24"
                  Height="24"
                  Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"
                  Fill="{TemplateBinding Foreground}"
                  RenderTransformOrigin="0.5,0.5"
                  Stretch="Fill">
              <Path.RenderTransform>
                <TransformGroup>
                  <ScaleTransform ScaleY="0" />
                  <SkewTransform />
                  <RotateTransform />
                  <TranslateTransform />
                </TransformGroup>
              </Path.RenderTransform>
            </Path>
          </Viewbox>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
 
  <Style TargetType="{x:Type local:ColorZone}">
    <Style.Resources>
      <converters:ShadowOpacityMaskConverter x:Key="ShadowOpacityMaskConverter" />
    </Style.Resources>
    <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Background}" />
    <Setter Property="ClipToBounds" Value="False" />
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:ColorZone}">
          <Grid Background="Transparent">
            <Grid.OpacityMask>
              <MultiBinding Converter="{StaticResource ShadowOpacityMaskConverter}">
                <Binding Path="ActualWidth" RelativeSource="{RelativeSource TemplatedParent}" />
                <Binding Path="ActualHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                <Binding Path="(local:ElevationAssist.Elevation)" RelativeSource="{RelativeSource TemplatedParent}" />
              </MultiBinding>
            </Grid.OpacityMask>
            <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
              <Border Background="{TemplateBinding Background}"
                      CornerRadius="{TemplateBinding CornerRadius}"
                      Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ElevationAssist.Elevation), Converter={x:Static converters:ShadowConverter.Instance}}" />
            </AdornerDecorator>
            <Border Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    ClipToBounds="{TemplateBinding ClipToBounds}"
                    CornerRadius="{TemplateBinding CornerRadius}">
              <ContentPresenter Margin="{TemplateBinding Padding}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                Cursor="{TemplateBinding Cursor}"
                                RecognizesAccessKey="True"
                                TextElement.Foreground="{TemplateBinding Foreground}" />
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Style.Triggers>
      <Trigger Property="Mode" Value="Inverted">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Background}" />
      </Trigger>
      <Trigger Property="Mode" Value="PrimaryLight">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Light.Foreground}" />
      </Trigger>
      <Trigger Property="Mode" Value="PrimaryMid">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Foreground}" />
      </Trigger>
      <Trigger Property="Mode" Value="PrimaryDark">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark.Foreground}" />
      </Trigger>
      <Trigger Property="Mode" Value="SecondaryLight">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary.Light}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Secondary.Light.Foreground}" />
      </Trigger>
      <Trigger Property="Mode" Value="SecondaryMid">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Secondary.Foreground}" />
      </Trigger>
      <Trigger Property="Mode" Value="SecondaryDark">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary.Dark}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Secondary.Dark.Foreground}" />
      </Trigger>
      <Trigger Property="Mode" Value="Light">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.ColorZone.LightBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.ColorZone.LightForeground}" />
      </Trigger>
      <Trigger Property="Mode" Value="Dark">
        <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.ColorZone.DarkBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.ColorZone.DarkForeground}" />
      </Trigger>
      <Trigger Property="Mode" Value="Custom">
        <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:ColorZoneAssist.Background)}" />
        <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:ColorZoneAssist.Foreground)}" />
      </Trigger>
    </Style.Triggers>
  </Style>
 
  <SolidColorBrush x:Key="BlackBackground" Color="Black" po:Freeze="True" />
 
  <Style TargetType="{x:Type local:DrawerHost}">
    <Style.Resources>
      <converters:DrawerOffsetConverter x:Key="DrawerOffsetConverter" />
    </Style.Resources>
    <Setter Property="BottomDrawerBackground" Value="{DynamicResource MaterialDesign.Brush.Background}" />
    <Setter Property="ClipToBounds" Value="True" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="LeftDrawerBackground" Value="{DynamicResource MaterialDesign.Brush.Background}" />
    <Setter Property="OverlayBackground" Value="{StaticResource BlackBackground}" />
    <Setter Property="RightDrawerBackground" Value="{DynamicResource MaterialDesign.Brush.Background}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:DrawerHost}">
          <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="AllDrawers">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="AllClosed" To="AnyOpen">
                    <Storyboard>
                      <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="IsHitTestVisible">
                        <DiscreteBooleanKeyFrame KeyTime="0" Value="True" />
                      </BooleanAnimationUsingKeyFrames>
                      <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Tag">
                        <DiscreteBooleanKeyFrame KeyTime="0" Value="False" />
                      </BooleanAnimationUsingKeyFrames>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value=".56">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="AnyOpen" To="AllClosed">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0.56" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseInOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="AnyOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PART_ContentCover"
                                     Storyboard.TargetProperty="Opacity"
                                     To=".56"
                                     Duration="0" />
                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="IsHitTestVisible">
                      <DiscreteBooleanKeyFrame KeyTime="0" Value="True" />
                    </BooleanAnimationUsingKeyFrames>
                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Tag">
                      <DiscreteBooleanKeyFrame KeyTime="0" Value="False" />
                    </BooleanAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="AllClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="PART_ContentCover"
                                     Storyboard.TargetProperty="Opacity"
                                     To="0" />
                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover" Storyboard.TargetProperty="IsHitTestVisible">
                      <DiscreteBooleanKeyFrame Value="False" />
                    </BooleanAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="LeftDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="LeftDrawerClosed" To="LeftDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PART_LeftDrawer" Storyboard.TargetProperty="Margin">
                        <EasingThicknessKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="LeftDrawerShadow"
                                       Storyboard.TargetProperty="Opacity"
                                       From="0"
                                       To="1"
                                       Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="LeftDrawerOpen" To="LeftDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetName="PART_LeftDrawer"
                                          Storyboard.TargetProperty="Margin"
                                          Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LeftDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.36" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="LeftDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="LeftDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="1"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_LeftDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        To="0"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="LeftDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="LeftDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="0"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_LeftDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="RightDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="RightDrawerClosed" To="RightDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PART_RightDrawer" Storyboard.TargetProperty="Margin">
                        <EasingThicknessKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="RightDrawerShadow"
                                       Storyboard.TargetProperty="Opacity"
                                       From="0"
                                       To="1"
                                       Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="RightDrawerOpen" To="RightDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetName="PART_RightDrawer"
                                          Storyboard.TargetProperty="Margin"
                                          Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RightDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.36" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="RightDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="RightDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="1"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_RightDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        To="0 0 0 0"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="RightDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="RightDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="0"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_RightDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="TopDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="TopDrawerClosed" To="TopDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PART_TopDrawer" Storyboard.TargetProperty="Margin">
                        <EasingThicknessKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="TopDrawerShadow"
                                       Storyboard.TargetProperty="Opacity"
                                       From="0"
                                       To="1"
                                       Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="TopDrawerOpen" To="TopDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetName="PART_TopDrawer"
                                          Storyboard.TargetProperty="Margin"
                                          Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.36" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="TopDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="TopDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="1"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_TopDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        To="0"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="TopDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="TopDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="0"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_TopDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="BottomDrawer">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="BottomDrawerClosed" To="BottomDrawerOpen">
                    <Storyboard>
                      <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PART_BottomDrawer" Storyboard.TargetProperty="Margin">
                        <EasingThicknessKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingThicknessKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingThicknessKeyFrame.EasingFunction>
                        </EasingThicknessKeyFrame>
                      </ThicknessAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetName="BottomDrawerShadow"
                                       Storyboard.TargetProperty="Opacity"
                                       From="0"
                                       To="1"
                                       Duration="0:0:0.04" />
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="BottomDrawerOpen" To="BottomDrawerClosed">
                    <Storyboard>
                      <ThicknessAnimation Storyboard.TargetName="PART_BottomDrawer"
                                          Storyboard.TargetProperty="Margin"
                                          Duration="0:0:0.4">
                        <ThicknessAnimation.EasingFunction>
                          <SineEase EasingMode="EaseOut" />
                        </ThicknessAnimation.EasingFunction>
                      </ThicknessAnimation>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomDrawerShadow" Storyboard.TargetProperty="Opacity">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.36" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
                          <EasingDoubleKeyFrame.EasingFunction>
                            <SineEase EasingMode="EaseOut" />
                          </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="BottomDrawerOpen">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="BottomDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="1"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_BottomDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        To="0 0 0 0"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="BottomDrawerClosed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="BottomDrawerShadow"
                                     Storyboard.TargetProperty="Opacity"
                                     From="0"
                                     To="0"
                                     Duration="0" />
                    <ThicknessAnimation Storyboard.TargetName="PART_BottomDrawer"
                                        Storyboard.TargetProperty="Margin"
                                        Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="RootGrid">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
              </Grid.RowDefinitions>
              <AdornerDecorator Grid.Row="1" Grid.Column="1">
                <ContentPresenter x:Name="ContentPresenter"
                                  Content="{TemplateBinding Content}"
                                  ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                  ContentTemplate="{TemplateBinding ContentTemplate}">
                  <ContentPresenter.Tag>
                    <system:Boolean>False</system:Boolean>
                  </ContentPresenter.Tag>
                </ContentPresenter>
              </AdornerDecorator>
              <Grid x:Name="PART_ContentCover"
                    Grid.Row="0"
                    Grid.RowSpan="3"
                    Grid.Column="0"
                    Grid.ColumnSpan="3"
                    Focusable="False"
                    IsHitTestVisible="False"
                    Opacity="0">
                <Grid.Style>
                  <Style TargetType="Grid">
                    <Setter Property="Background" Value="{Binding OverlayBackground, RelativeSource={RelativeSource TemplatedParent}}" />
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                        <Setter Property="Background" Value="{x:Null}" />
                      </DataTrigger>
                      <Trigger Property="Opacity" Value="0">
                        <Setter Property="Visibility" Value="Hidden" />
                      </Trigger>
                    </Style.Triggers>
                  </Style>
                </Grid.Style>
              </Grid>
              <Grid x:Name="PART_LeftDrawer"
                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth, Converter={x:Static converters:DrawerOffsetConverter.Instance}, ConverterParameter={x:Static Dock.Left}}"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Stretch"
                    Panel.ZIndex="{TemplateBinding LeftDrawerZIndex}">
                <Grid.Style>
                  <Style TargetType="Grid">
                    <Setter Property="Grid.Column" Value="1" />
                    <Setter Property="Grid.Row" Value="1" />
                    <Setter Property="Grid.RowSpan" Value="1" />
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                        <Setter Property="Grid.Column" Value="0" />
                        <Setter Property="Grid.Row" Value="0" />
                        <Setter Property="Grid.RowSpan" Value="3" />
                      </DataTrigger>
                    </Style.Triggers>
                  </Style>
                </Grid.Style>
 
                <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                  <Border x:Name="LeftDrawerShadow"
                          Background="{TemplateBinding LeftDrawerBackground}"
                          CornerRadius="{TemplateBinding LeftDrawerCornerRadius}"
                          Opacity="0">
                    <Border.Style>
                      <Style TargetType="Border">
                        <Setter Property="Effect" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ElevationAssist.Elevation), Converter={x:Static converters:ShadowConverter.Instance}}" />
                        <Style.Triggers>
                          <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                            <Setter Property="Effect" Value="{x:Null}" />
                          </DataTrigger>
                        </Style.Triggers>
                      </Style>
                    </Border.Style>
                  </Border>
                </AdornerDecorator>
                <ContentPresenter Content="{TemplateBinding LeftDrawerContent}"
                                  ContentStringFormat="{TemplateBinding LeftDrawerContentStringFormat}"
                                  ContentTemplate="{TemplateBinding LeftDrawerContentTemplate}"
                                  ContentTemplateSelector="{TemplateBinding LeftDrawerContentTemplateSelector}"
                                  IsEnabled="{TemplateBinding IsLeftDrawerOpen}" />
              </Grid>
              <Grid x:Name="PART_RightDrawer"
                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth, Converter={x:Static converters:DrawerOffsetConverter.Instance}, ConverterParameter={x:Static Dock.Right}}"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Stretch"
                    Panel.ZIndex="{TemplateBinding RightDrawerZIndex}">
                <Grid.Style>
                  <Style TargetType="Grid">
                    <Setter Property="Grid.Column" Value="1" />
                    <Setter Property="Grid.Row" Value="1" />
                    <Setter Property="Grid.RowSpan" Value="1" />
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                        <Setter Property="Grid.Column" Value="2" />
                        <Setter Property="Grid.Row" Value="0" />
                        <Setter Property="Grid.RowSpan" Value="3" />
                      </DataTrigger>
                    </Style.Triggers>
                  </Style>
                </Grid.Style>
                <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                  <Border x:Name="RightDrawerShadow"
                          Background="{TemplateBinding RightDrawerBackground}"
                          CornerRadius="{TemplateBinding RightDrawerCornerRadius}"
                          Opacity="0">
                    <Border.Style>
                      <Style TargetType="Border">
                        <Setter Property="Effect" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ElevationAssist.Elevation), Converter={x:Static converters:ShadowConverter.Instance}}" />
                        <Style.Triggers>
                          <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                            <Setter Property="Effect" Value="{x:Null}" />
                          </DataTrigger>
                        </Style.Triggers>
                      </Style>
                    </Border.Style>
                  </Border>
                </AdornerDecorator>
                <ContentPresenter Content="{TemplateBinding RightDrawerContent}"
                                  ContentStringFormat="{TemplateBinding RightDrawerContentStringFormat}"
                                  ContentTemplate="{TemplateBinding RightDrawerContentTemplate}"
                                  ContentTemplateSelector="{TemplateBinding RightDrawerContentTemplateSelector}"
                                  IsEnabled="{TemplateBinding IsRightDrawerOpen}" />
              </Grid>
              <Grid x:Name="PART_TopDrawer"
                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight, Converter={x:Static converters:DrawerOffsetConverter.Instance}, ConverterParameter={x:Static Dock.Top}}"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Top"
                    Panel.ZIndex="{TemplateBinding TopDrawerZIndex}">
                <Grid.Style>
                  <Style TargetType="Grid">
                    <Setter Property="Grid.Column" Value="1" />
                    <Setter Property="Grid.Row" Value="1" />
                    <Setter Property="Grid.RowSpan" Value="1" />
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                        <Setter Property="Grid.Column" Value="0" />
                        <Setter Property="Grid.ColumnSpan" Value="3" />
                        <Setter Property="Grid.Row" Value="0" />
                      </DataTrigger>
                    </Style.Triggers>
                  </Style>
                </Grid.Style>
                <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                  <Border x:Name="TopDrawerShadow"
                          Background="{TemplateBinding TopDrawerBackground}"
                          CornerRadius="{TemplateBinding TopDrawerCornerRadius}"
                          Opacity="0">
                    <Border.Style>
                      <Style TargetType="Border">
                        <Setter Property="Effect" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ElevationAssist.Elevation), Converter={x:Static converters:ShadowConverter.Instance}}" />
                        <Style.Triggers>
                          <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                            <Setter Property="Effect" Value="{x:Null}" />
                          </DataTrigger>
                        </Style.Triggers>
                      </Style>
                    </Border.Style>
                  </Border>
                </AdornerDecorator>
                <ContentPresenter Content="{TemplateBinding TopDrawerContent}"
                                  ContentStringFormat="{TemplateBinding TopDrawerContentStringFormat}"
                                  ContentTemplate="{TemplateBinding TopDrawerContentTemplate}"
                                  ContentTemplateSelector="{TemplateBinding TopDrawerContentTemplateSelector}"
                                  IsEnabled="{TemplateBinding IsTopDrawerOpen}" />
              </Grid>
              <Grid x:Name="PART_BottomDrawer"
                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight, Converter={x:Static converters:DrawerOffsetConverter.Instance}, ConverterParameter={x:Static Dock.Bottom}}"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Bottom"
                    Panel.ZIndex="{TemplateBinding BottomDrawerZIndex}">
                <Grid.Style>
                  <Style TargetType="Grid">
                    <Setter Property="Grid.Column" Value="1" />
                    <Setter Property="Grid.Row" Value="1" />
                    <Setter Property="Grid.RowSpan" Value="1" />
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                        <Setter Property="Grid.Column" Value="0" />
                        <Setter Property="Grid.ColumnSpan" Value="3" />
                        <Setter Property="Grid.Row" Value="2" />
                      </DataTrigger>
                    </Style.Triggers>
                  </Style>
                </Grid.Style>
                <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:ShadowAssist.CacheMode)}">
                  <Border x:Name="BottomDrawerShadow"
                          Background="{TemplateBinding BottomDrawerBackground}"
                          CornerRadius="{TemplateBinding BottomDrawerCornerRadius}"
                          Opacity="0">
                    <Border.Style>
                      <Style TargetType="Border">
                        <Setter Property="Effect" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ElevationAssist.Elevation), Converter={x:Static converters:ShadowConverter.Instance}}" />
                        <Style.Triggers>
                          <DataTrigger Binding="{Binding OpenMode, RelativeSource={RelativeSource TemplatedParent}}" Value="Standard">
                            <Setter Property="Effect" Value="{x:Null}" />
                          </DataTrigger>
                        </Style.Triggers>
                      </Style>
                    </Border.Style>
                  </Border>
                </AdornerDecorator>
                <ContentPresenter Content="{TemplateBinding BottomDrawerContent}"
                                  ContentStringFormat="{TemplateBinding BottomDrawerContentStringFormat}"
                                  ContentTemplate="{TemplateBinding BottomDrawerContentTemplate}"
                                  ContentTemplateSelector="{TemplateBinding BottomDrawerContentTemplateSelector}"
                                  IsEnabled="{TemplateBinding IsBottomDrawerOpen}" />
              </Grid>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="TopDrawerBackground" Value="{DynamicResource MaterialDesign.Brush.Background}" />
    <Setter Property="local:ElevationAssist.Elevation" Value="Dp8" />
  </Style>
 
  <Style TargetType="{x:Type local:PackIcon}">
    <Setter Property="FlowDirection" Value="LeftToRight" />
    <Setter Property="Height" Value="16" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:PackIcon}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <Viewbox FlowDirection="{TemplateBinding FlowDirection}">
              <Canvas Width="24" Height="24">
                <Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}}" Fill="{TemplateBinding Foreground}" />
              </Canvas>
            </Viewbox>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="Width" Value="16" />
  </Style>
 
  <Style TargetType="{x:Type transitions:Transitioner}">
    <Setter Property="ClipToBounds" Value="True" />
    <Setter Property="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <Grid IsItemsHost="True" />
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type transitions:Transitioner}">
          <Border Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <ItemsPresenter x:Name="ItemsPresenter" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="SelectedIndex" Value="-1">
              <Setter TargetName="ItemsPresenter" Property="Visibility" Value="Hidden" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
 
  <Style TargetType="{x:Type transitions:TransitioningContentBase}">
    <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type transitions:TransitioningContentBase}">
          <Border x:Name="Border"
                  Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <ContentPresenter x:Name="ContentPresenter"
                              Margin="{TemplateBinding Padding}"
                              Content="{TemplateBinding ContentControl.Content}"
                              ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
                              ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                              ContentTemplateSelector="{TemplateBinding ContentControl.ContentTemplateSelector}"
                              RenderTransformOrigin=".5,.5">
              <ContentPresenter.RenderTransform>
                <TransformGroup>
                  <MatrixTransform x:Name="PART_MatrixTransform" />
                  <RotateTransform x:Name="PART_RotateTransform" Angle="0" />
                  <ScaleTransform x:Name="PART_ScaleTransform" ScaleX="1" ScaleY="1" />
                  <SkewTransform x:Name="PART_SkewTransform" AngleX="0" AngleY="0" />
                  <TranslateTransform x:Name="PART_TranslateTransform" X="0" Y="0" />
                </TransformGroup>
              </ContentPresenter.RenderTransform>
            </ContentPresenter>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
 
  <Style TargetType="{x:Type transitions:TransitioningContent}" BasedOn="{StaticResource {x:Type transitions:TransitioningContentBase}}" />
 
  <Style TargetType="{x:Type transitions:TransitionerSlide}" BasedOn="{StaticResource {x:Type transitions:TransitioningContentBase}}">
    <Style.Resources>
      <converters:NotZeroConverter x:Key="NotZeroConverter" />
    </Style.Resources>
    <Setter Property="IsEnabled" Value="False" />
    <Setter Property="RenderTransformOrigin" Value=".5,.5" />
    <Setter Property="Visibility" Value="Hidden" />
    <Style.Triggers>
      <Trigger Property="State" Value="Current">
        <Setter Property="IsEnabled" Value="True" />
        <Setter Property="Visibility" Value="Visible" />
      </Trigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding State, RelativeSource={RelativeSource Self}}" Value="Previous" />
          <Condition Binding="{Binding Opacity, RelativeSource={RelativeSource Self}, Converter={StaticResource NotZeroConverter}}" Value="True" />
        </MultiDataTrigger.Conditions>
        <Setter Property="Visibility" Value="Visible" />
      </MultiDataTrigger>
    </Style.Triggers>
  </Style>
 
</ResourceDictionary>