我可以在 XAML 中更改 material 设计 PopupBox 的行为吗?

Can I change the behavior of the material design PopupBox in XAML?

我在 XAML 中将 WPF 与 Material Design 一起使用。我的代码非常简单:

<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionAccentPopupBox}"
                         HorizontalAlignment="Right" VerticalAlignment="Bottom"
                         Margin="32">
   <StackPanel>
      <Button x:Name="ImprimirButton" ToolTip="Imprimir">
         <Button.Background>
            <SolidColorBrush Color="{StaticResource Light BluePrimary500}" />
         </Button.Background>
         <Button.Foreground>
            <SolidColorBrush Color="{StaticResource Light BluePrimary500Foreground}" />
         </Button.Foreground>
         <materialDesign:PackIcon Kind="Printer" />
      </Button>
   </StackPanel>
</materialDesign:PopupBox>

此浮动 PopupBox 的行为是在鼠标悬停时显示按钮。我想更改它以在单击鼠标时显示按钮。这可能吗?

当鼠标悬停在浮动的上方时PopupBox,也会触发事件,显示所有的按钮,很烦

这是 MaterialDesignMultiFloatingActionAccentPopupBox 样式的默认行为,默认弹出模式为 MouseOverEager。只需将 PopupBox 上的 PopupMode 设置为 Click

<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionAccentPopupBox}"
                         PopupMode="Click"
                         HorizontalAlignment="Right"
                         VerticalAlignment="Bottom"
                         Margin="32">
   <!-- ...your XAML code. -->
</materialDesign:PopupBox>