Files
HandyControl/src/Shared/HandyControl_Shared/Themes/Styles/Base/MagnifierBaseStyle.xaml
T
2020-06-20 18:51:53 +08:00

34 lines
1.8 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls"
xmlns:themes="clr-namespace:HandyControl.Themes">
<ResourceDictionary.MergedDictionaries>
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/Border.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="MagnifierBaseStyle" TargetType="hc:Magnifier">
<Setter Property="IsHitTestVisible" Value="False" />
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Width" Value="180"/>
<Setter Property="Height" Value="180"/>
<Setter Property="BorderThickness" Value="8"/>
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="hc:Magnifier">
<Border Style="{StaticResource BorderCircular}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Ellipse>
<Ellipse.Fill>
<VisualBrush Visual="{Binding Target,RelativeSource={RelativeSource TemplatedParent}}" ViewboxUnits="Absolute" x:Name="PART_VisualBrush"/>
</Ellipse.Fill>
</Ellipse>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>