Files
ShrlAlgoToolkit/WPFluent/Controls/Flyout/Flyout.xaml
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

66 lines
3.6 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:WPFluent.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:Flyout}" x:Key="DefaultFlyoutStyle">
<Setter Property="Background" Value="{DynamicResource AcrylicBackgroundFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SurfaceStrokeColorFlyoutBrush}" />
<Setter Property="Margin" Value="0" />
<Setter Property="MinWidth" Value="20" />
<Setter Property="MinHeight" Value="20" />
<Setter Property="Padding" Value="12" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Placement" Value="Top" />
<Setter Property="Popup.AllowsTransparency" Value="True" />
<Setter Property="Popup.StaysOpen" Value="False" />
<Setter Property="Popup.PopupAnimation" Value="Fade" />
<Setter Property="Popup.VerticalOffset" Value="1" />
<Setter Property="Focusable" Value="False" />
<Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Flyout}">
<Grid>
<Popup
AllowsTransparency="{TemplateBinding Popup.AllowsTransparency}"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
IsOpen="{TemplateBinding IsOpen}"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Placement="{TemplateBinding Placement}"
PopupAnimation="{TemplateBinding Popup.PopupAnimation}"
StaysOpen="{TemplateBinding Popup.StaysOpen}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
VerticalOffset="1"
x:Name="PART_Popup">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="{DynamicResource PopupCornerRadius}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Margin}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PopupBorder">
<ContentPresenter Content="{TemplateBinding Content}" />
</Border>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultFlyoutStyle}" TargetType="{x:Type controls:Flyout}" />
</ResourceDictionary>