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

56 lines
2.8 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type ToolTip}" x:Key="DefaultToolTipStyle">
<Setter Property="MaxWidth" Value="600" />
<Setter Property="Height" Value="Auto" />
<Setter Property="Width" Value="Auto" />
<Setter Property="TextElement.FontSize" Value="12" />
<Setter Property="TextBlock.TextAlignment" Value="Justify" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource AcrylicBackgroundFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SurfaceStrokeColorFlyoutBrush}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="4"
Height="{TemplateBinding Height}"
MaxWidth="{TemplateBinding MaxWidth}"
Name="Border"
Padding="8"
SnapsToDevicePixels="True"
Width="{TemplateBinding Width}">
<Border.Effect>
<DropShadowEffect
BlurRadius="30"
Color="#202020"
Direction="0"
Opacity="0.4"
ShadowDepth="0" />
</Border.Effect>
<ContentPresenter
HorizontalAlignment="Left"
Margin="4"
VerticalAlignment="Top">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultToolTipStyle}" TargetType="{x:Type ToolTip}" />
</ResourceDictionary>