Themes/MaterialDesignTheme.PopupBox.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:wpf="clr-namespace:MaterialDesignThemes.Wpf">
 
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Menu.xaml" />
    <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToolTip.xaml" />
  </ResourceDictionary.MergedDictionaries>
 
  <Style x:Key="MaterialDesignPopupBoxButton" TargetType="{x:Type Button}">
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
    <Setter Property="HorizontalContentAlignment" Value="Left" />
    <Setter Property="Padding" Value="16,0,16,16" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup Name="CommonStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0:0:0.3" To="Normal">
                    <VisualTransition.GeneratedEasingFunction>
                      <CircleEase EasingMode="EaseOut" />
                    </VisualTransition.GeneratedEasingFunction>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState Name="Normal" />
                <VisualState Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="MouseOverBorder"
                                     Storyboard.TargetProperty="Opacity"
                                     To="0.1"
                                     Duration="0" />
                  </Storyboard>
                </VisualState>
                <VisualState Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                     To="0.48"
                                     Duration="0" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="MouseOverBorder"
                    Background="{TemplateBinding Foreground, Converter={x:Static converters:BrushRoundConverter.Instance}}"
                    Opacity="0" />
            <wpf:Ripple MinHeight="48"
                        Padding="{TemplateBinding Padding}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                        Feedback="{TemplateBinding Foreground, Converter={x:Static converters:BrushRoundConverter.Instance}}"
                        Focusable="False"
                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="VerticalContentAlignment" Value="Bottom" />
  </Style>
 
  <wpf:PackIcon x:Key="MaterialDesignPopupBoxToggleContent"
                Width="24"
                Height="24"
                Margin="4,0,4,0"
                x:Shared="False"
                Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=Foreground}"
                Kind="DotsVertical" />
 
  <Style x:Key="MaterialDesignPopupBox" TargetType="{x:Type wpf:PopupBox}">
    <Setter Property="Focusable" Value="True" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="Padding" Value="0,8,0,8" />
    <Setter Property="PopupElevation" Value="Dp6" />
    <Setter Property="PopupHorizontalOffset" Value="0" />
    <Setter Property="PopupUniformCornerRadius" Value="2" />
    <Setter Property="PopupVerticalOffset" Value="0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type wpf:PopupBox}">
          <ControlTemplate.Resources>
            <converters:ElevationMarginConverter x:Key="ElevationMarginConverter" />
            <converters:ElevationRadiusConverter x:Key="ElevationRadiusConverter" Multiplier="-1" />
            <converters:ElevationRadiusConverter x:Key="RtlElevationRadiusConverter" Multiplier="1" />
 
            <Style TargetType="Separator" BasedOn="{StaticResource MaterialDesignSeparator}" />
            <Style x:Key="ToggleButtonStyle" TargetType="ToggleButton">
              <Setter Property="Template">
                <Setter.Value>
                  <ControlTemplate TargetType="ToggleButton">
                    <wpf:Ripple Padding="{TemplateBinding Padding}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                Focusable="False"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                  </ControlTemplate>
                </Setter.Value>
              </Setter>
            </Style>
          </ControlTemplate.Resources>
          <Grid>
            <ToggleButton x:Name="PART_Toggle"
                          VerticalAlignment="Center"
                          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                          Content="{TemplateBinding ToggleContent}"
                          ContentTemplate="{TemplateBinding ToggleContentTemplate}"
                          ContentTemplateSelector="{TemplateBinding ToggleContentTemplateSelector}"
                          Cursor="Hand"
                          Foreground="{TemplateBinding Foreground}"
                          IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPopupOpen, Mode=TwoWay}"
                          IsTabStop="{TemplateBinding IsTabStop}"
                          Padding="0"
                          Style="{StaticResource ToggleButtonStyle}"
                          TabIndex="{TemplateBinding TabIndex}" />
            <wpf:PopupEx x:Name="PART_Popup"
                         AllowsTransparency="True"
                         CustomPopupPlacementCallback="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PopupPlacementMethod}"
                         HorizontalOffset="{TemplateBinding PopupElevation, Converter={StaticResource ElevationRadiusConverter}}"
                         IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPopupOpen, Mode=TwoWay}"
                         Placement="Custom"
                         PopupAnimation="Fade"
                         VerticalOffset="{TemplateBinding PopupElevation, Converter={StaticResource ElevationRadiusConverter}}">
              <wpf:PopupEx.PlacementTarget>
                <MultiBinding Converter="{x:Static converters:FirstNonNullConverter.Instance}">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="PlacementTarget" />
                  <Binding ElementName="PART_Toggle" />
                </MultiBinding>
              </wpf:PopupEx.PlacementTarget>
              <wpf:Card Margin="{TemplateBinding PopupElevation, Converter={StaticResource ElevationMarginConverter}}"
                        Padding="{TemplateBinding Padding}"
                        wpf:ElevationAssist.Elevation="{TemplateBinding PopupElevation}"
                        Content="{TemplateBinding PopupContent}"
                        ContentTemplate="{TemplateBinding PopupContentTemplate}"
                        Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
                        RenderOptions.ClearTypeHint="Enabled"
                        UniformCornerRadius="{TemplateBinding PopupUniformCornerRadius}">
                <wpf:Card.Resources>
                  <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignPopupBoxButton}" />
                </wpf:Card.Resources>
              </wpf:Card>
            </wpf:PopupEx>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" Value="0.38" />
            </Trigger>
            <Trigger Property="FlowDirection" Value="RightToLeft">
              <Setter TargetName="PART_Popup" Property="HorizontalOffset" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ElevationAssist.Elevation), Converter={StaticResource RtlElevationRadiusConverter}}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="TextElement.FontWeight" Value="Normal" />
    <Setter Property="ToggleContent" Value="{StaticResource MaterialDesignPopupBoxToggleContent}" />
    <Setter Property="ToolTipService.IsEnabled" Value="{Binding IsPopupOpen, RelativeSource={RelativeSource Self}, Converter={x:Static converters:NotConverter.Instance}}" />
    <Setter Property="wpf:RippleAssist.ClipToBounds" Value="False" />
    <Setter Property="wpf:RippleAssist.Feedback" Value="{DynamicResource MaterialDesign.Brush.Button.Ripple}" />
    <Setter Property="wpf:RippleAssist.IsCentered" Value="True" />
  </Style>
 
  <Style x:Key="MaterialDesignToolPopupBox"
         TargetType="wpf:PopupBox"
         BasedOn="{StaticResource MaterialDesignPopupBox}">
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.ToolBar.Item.Foreground}" />
    <Setter Property="Padding" Value="4" />
  </Style>
 
  <Style x:Key="MaterialDesignToolForegroundPopupBox"
         TargetType="wpf:PopupBox"
         BasedOn="{StaticResource MaterialDesignToolPopupBox}">
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
  </Style>
 
  <wpf:PackIcon x:Key="MaterialDesignMultiFloatingActionPopupBoxIcon"
                Width="24"
                Height="24"
                x:Shared="False"
                Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=Foreground}"
                Kind="Plus" />
 
  <Style x:Key="MaterialDesignMultiFloatingActionPopupBox" TargetType="{x:Type wpf:PopupBox}">
    <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
    <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Cursor" Value="Hand" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Foreground}" />
    <Setter Property="Height" Value="56" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="PlacementMode" Value="TopAndAlignCentres" />
    <Setter Property="PopupMode" Value="Click" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type wpf:PopupBox}">
          <ControlTemplate.Resources>
            <Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource MaterialDesignToolTip}">
              <Style.Setters>
                <Setter Property="Margin" Value="8,10,8,10" />
              </Style.Setters>
            </Style>
            <Style x:Key="ToggleButtonStyle" TargetType="ToggleButton">
              <Setter Property="Template">
                <Setter.Value>
                  <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="RootGrid" Background="{x:Null}">
                      <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup Name="CheckedStates">
                          <VisualStateGroup.Transitions>
                            <VisualTransition From="*" To="Checked">
                              <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="ContentRotateTransform"
                                                 Storyboard.TargetProperty="Angle"
                                                 To="45"
                                                 Duration="0:0:0.1">
                                  <DoubleAnimation.EasingFunction>
                                    <QuadraticEase EasingMode="EaseInOut" />
                                  </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                              </Storyboard>
                            </VisualTransition>
                            <VisualTransition From="Checked" To="Unchecked">
                              <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="ContentRotateTransform"
                                                 Storyboard.TargetProperty="Angle"
                                                 To="0"
                                                 Duration="0:0:0.1">
                                  <DoubleAnimation.EasingFunction>
                                    <QuadraticEase EasingMode="EaseInOut" />
                                  </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                              </Storyboard>
                            </VisualTransition>
                          </VisualStateGroup.Transitions>
                          <VisualState x:Name="Checked">
                            <Storyboard>
                              <DoubleAnimation Storyboard.TargetName="ContentRotateTransform"
                                               Storyboard.TargetProperty="Angle"
                                               To="45"
                                               Duration="0" />
                            </Storyboard>
                          </VisualState>
                          <VisualState x:Name="Unchecked">
                            <Storyboard>
                              <DoubleAnimation Storyboard.TargetName="ContentRotateTransform"
                                               Storyboard.TargetProperty="Angle"
                                               To="0"
                                               Duration="0" />
                            </Storyboard>
                          </VisualState>
                        </VisualStateGroup>
                      </VisualStateManager.VisualStateGroups>
                      <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
                        <Ellipse x:Name="border"
                                 Effect="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=(wpf:ElevationAssist.Elevation), Converter={x:Static converters:ShadowConverter.Instance}}"
                                 Fill="{TemplateBinding Background}"
                                 Stroke="{TemplateBinding BorderBrush}"
                                 StrokeThickness="{TemplateBinding BorderThickness}" />
                      </AdornerDecorator>
                      <wpf:Ripple Padding="{TemplateBinding Padding}"
                                  HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                  Clip="{Binding ElementName=GeometryEllipse, Path=RenderedGeometry}"
                                  ClipToBounds="True"
                                  Focusable="False"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <!-- additional layer so we don't rotate the ripple directly which can cause jumpyness under certain layouts -->
                        <ContentControl Content="{TemplateBinding Content}"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        Focusable="False"
                                        RenderTransformOrigin=".5,.5">
                          <ContentControl.RenderTransform>
                            <RotateTransform x:Name="ContentRotateTransform" Angle="0" />
                          </ContentControl.RenderTransform>
                        </ContentControl>
                      </wpf:Ripple>
                      <Ellipse x:Name="GeometryEllipse"
                               Fill="Transparent"
                               Focusable="False"
                               IsHitTestVisible="False" />
                    </Grid>
                    <ControlTemplate.Triggers>
                      <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Opacity" Value="0.38" />
                      </Trigger>
                      <Trigger Property="IsMouseOver" Value="True">
                        <Setter TargetName="border" Property="wpf:ShadowAssist.Darken" Value="True" />
                      </Trigger>
                      <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=PopupMode}" Value="{x:Static wpf:PopupBoxPopupMode.MouseOver}">
                        <Setter TargetName="RootGrid" Property="Background" Value="Transparent" />
                      </DataTrigger>
                      <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=PopupMode}" Value="{x:Static wpf:PopupBoxPopupMode.MouseOverEager}">
                        <Setter TargetName="RootGrid" Property="Background" Value="Transparent" />
                      </DataTrigger>
                    </ControlTemplate.Triggers>
                  </ControlTemplate>
                </Setter.Value>
              </Setter>
            </Style>
            <Storyboard x:Key="Open">
              <DoubleAnimation Storyboard.TargetName="PART_PopupContentControl"
                               Storyboard.TargetProperty="Opacity"
                               To="1"
                               Duration="0:0:0.1">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
              <DoubleAnimation Storyboard.TargetName="ExplicitToggleContent"
                               Storyboard.TargetProperty="Opacity"
                               To="0"
                               Duration="0:0:0.1">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
              <DoubleAnimation Storyboard.TargetName="ExplicitToggleCheckedContent"
                               Storyboard.TargetProperty="Opacity"
                               To="1"
                               Duration="0:0:0.1">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
            </Storyboard>
            <Storyboard x:Key="Close">
              <DoubleAnimation Storyboard.TargetName="PART_PopupContentControl"
                               Storyboard.TargetProperty="Opacity"
                               Duration="0:0:0.8">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
              <DoubleAnimation Storyboard.TargetName="ExplicitToggleContent"
                               Storyboard.TargetProperty="Opacity"
                               To="1"
                               Duration="0:0:0.1">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
              <DoubleAnimation Storyboard.TargetName="ExplicitToggleCheckedContent"
                               Storyboard.TargetProperty="Opacity"
                               To="0"
                               Duration="0:0:0.1">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid>
            <ToggleButton x:Name="PART_Toggle"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          Cursor="Hand"
                          Foreground="{TemplateBinding Foreground}"
                          IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPopupOpen, Mode=TwoWay}"
                          IsTabStop="{TemplateBinding IsTabStop}"
                          Style="{StaticResource ToggleButtonStyle}"
                          ToolTip="{TemplateBinding ToolTip}"
                          ToolTipService.Placement="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=(ToolTipService.Placement)}">
              <Grid>
                <ContentControl x:Name="StandardToggleContent"
                                Content="{TemplateBinding ToggleContent}"
                                ContentTemplate="{TemplateBinding ToggleContentTemplate}"
                                ContentTemplateSelector="{TemplateBinding ToggleContentTemplateSelector}"
                                Focusable="False"
                                Visibility="{TemplateBinding ToggleCheckedContent, Converter={x:Static converters:NullableToVisibilityConverter.NotCollapsedInstance}}" />
                <ContentControl x:Name="ExplicitToggleContent"
                                Content="{TemplateBinding ToggleContent}"
                                ContentTemplate="{TemplateBinding ToggleContentTemplate}"
                                ContentTemplateSelector="{TemplateBinding ToggleContentTemplateSelector}"
                                Focusable="False"
                                Visibility="{TemplateBinding ToggleCheckedContent, Converter={x:Static converters:NullableToVisibilityConverter.CollapsedInstance}}" />
                <ContentControl x:Name="ExplicitToggleCheckedContent"
                                Content="{TemplateBinding ToggleCheckedContent}"
                                ContentTemplate="{TemplateBinding ToggleCheckedContentTemplate}"
                                Focusable="False"
                                Opacity="0"
                                RenderTransformOrigin=".5,.5"
                                Visibility="{TemplateBinding ToggleCheckedContent, Converter={x:Static converters:NullableToVisibilityConverter.CollapsedInstance}}">
                  <ContentControl.RenderTransform>
                    <RotateTransform Angle="-45" />
                  </ContentControl.RenderTransform>
                </ContentControl>
              </Grid>
            </ToggleButton>
            <wpf:PopupEx x:Name="PART_Popup"
                         AllowsTransparency="True"
                         CustomPopupPlacementCallback="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PopupPlacementMethod}"
                         IsOpen="False"
                         Placement="Custom"
                         PopupAnimation="None">
              <wpf:PopupEx.PlacementTarget>
                <MultiBinding Converter="{x:Static converters:FirstNonNullConverter.Instance}">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="PlacementTarget" />
                  <Binding ElementName="PART_Toggle" />
                </MultiBinding>
              </wpf:PopupEx.PlacementTarget>
              <Grid>
                <!--
                  with PopupBox.PopupMode == MouseOverEager the popup is always open, with
                  content hidden. but Transparent doesn't seem to register hit test in the popup.
                  this opacity is the lowest I could get to register hit test. might try and speak
                  to MS about this one, I *think* it is a bug
                -->
                <Border Background="White" Opacity="0.002" />
                <ContentControl x:Name="PART_PopupContentControl"
                                Content="{TemplateBinding PopupContent}"
                                ContentTemplate="{TemplateBinding PopupContentTemplate}"
                                Opacity="0"
                                Visibility="{TemplateBinding IsEnabled, Converter={x:Static converters:BooleanToVisibilityConverter.CollapsedInstance}}">
                  <ContentControl.Resources>
                    <ResourceDictionary>
                      <Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource MaterialDesignToolTip}">
                        <Style.Setters>
                          <Setter Property="Margin" Value="16,4,16,4" />
                        </Style.Setters>
                      </Style>
                      <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignFloatingActionMiniLightButton}">
                        <Style.Setters>
                          <Setter Property="ToolTipService.Placement" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=(ToolTipService.Placement)}" />
                          <Setter Property="ToolTipService.InitialShowDelay" Value="0" />
                          <Setter Property="Margin" Value="4" />
                        </Style.Setters>
                      </Style>
                    </ResourceDictionary>
                  </ContentControl.Resources>
                </ContentControl>
              </Grid>
            </wpf:PopupEx>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPopupOpen" Value="True">
              <Setter TargetName="PART_Popup" Property="IsOpen" Value="True" />
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Open}" />
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard Storyboard="{StaticResource Close}" />
              </Trigger.ExitActions>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="PopupMode" Value="MouseOverEager" />
                <Condition Property="IsVisible" Value="True" />
              </MultiTrigger.Conditions>
              <Setter TargetName="PART_Popup" Property="IsOpen" Value="True" />
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ToggleContent" Value="{StaticResource MaterialDesignMultiFloatingActionPopupBoxIcon}" />
    <Setter Property="ToolTipService.IsEnabled" Value="False" />
    <Setter Property="ToolTipService.Placement" Value="Left" />
    <Setter Property="Width" Value="56" />
    <Setter Property="wpf:ElevationAssist.Elevation" Value="Dp6" />
    <Setter Property="wpf:RippleAssist.Feedback" Value="White" />
    <Setter Property="wpf:RippleAssist.IsCentered" Value="True" />
    <Style.Triggers>
      <Trigger Property="UnfurlOrientation" Value="Horizontal">
        <Setter Property="ToolTipService.Placement" Value="Custom" />
      </Trigger>
    </Style.Triggers>
  </Style>
 
  <Style x:Key="MaterialDesignMultiFloatingActionLightPopupBox"
         TargetType="{x:Type wpf:PopupBox}"
         BasedOn="{StaticResource MaterialDesignMultiFloatingActionPopupBox}">
    <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
    <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Light.Foreground}" />
  </Style>
 
  <Style x:Key="MaterialDesignMultiFloatingActionDarkPopupBox"
         TargetType="{x:Type wpf:PopupBox}"
         BasedOn="{StaticResource MaterialDesignMultiFloatingActionPopupBox}">
    <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark}" />
    <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark}" />
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark.Foreground}" />
  </Style>
 
  <Style x:Key="MaterialDesignMultiFloatingActionSecondaryPopupBox"
         TargetType="{x:Type wpf:PopupBox}"
         BasedOn="{StaticResource MaterialDesignMultiFloatingActionPopupBox}">
    <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary}" />
    <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Secondary}" />
    <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Secondary.Foreground}" />
  </Style>
</ResourceDictionary>