MagnifierBaseStyle.xaml 1.6 KB

1234567891011121314151617181920212223242526272829
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:hc="clr-namespace:HandyControl.Controls">
  4. <Style x:Key="MagnifierBaseStyle" TargetType="hc:Magnifier">
  5. <Setter Property="IsHitTestVisible" Value="False" />
  6. <Setter Property="HorizontalAlignment" Value="Left"/>
  7. <Setter Property="VerticalAlignment" Value="Top"/>
  8. <Setter Property="Width" Value="180"/>
  9. <Setter Property="Height" Value="180"/>
  10. <Setter Property="BorderThickness" Value="8"/>
  11. <Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
  12. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
  13. <Setter Property="Template">
  14. <Setter.Value>
  15. <ControlTemplate TargetType="hc:Magnifier">
  16. <Border Style="{StaticResource BorderCircular}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  17. <Ellipse>
  18. <Ellipse.Fill>
  19. <VisualBrush Visual="{Binding Target,RelativeSource={RelativeSource TemplatedParent}}" ViewboxUnits="Absolute" x:Name="PART_VisualBrush"/>
  20. </Ellipse.Fill>
  21. </Ellipse>
  22. </Border>
  23. </ControlTemplate>
  24. </Setter.Value>
  25. </Setter>
  26. </Style>
  27. </ResourceDictionary>