All the controls missing in WPF. Over 1 million downloads.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
2.7 KiB

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Microsoft.Windows.Controls"
xmlns:magConverters="clr-namespace:Microsoft.Windows.Controls.Mag.Converters">
<!-- =============================================================================== -->
<!-- Magnifier -->
<!-- =============================================================================== -->
<magConverters:RadiusConverter x:Key="RadiusConverter"/>
<magConverters:BorderThicknessToStrokeThicknessConverter x:Key="BorderThicknessToStrokeThicknessConverter"/>
<Style TargetType="{x:Type local:Magnifier}">
<Setter Property="IsHitTestVisible" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:Magnifier}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Path=Radius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource RadiusConverter}}"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding Path=Radius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource RadiusConverter}}"/>
</Grid.RowDefinitions>
<Ellipse Width="{Binding Path=MagnifierWidth, RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=MagnifierHeight, RelativeSource={RelativeSource TemplatedParent}}" Fill="{TemplateBinding Background}"/>
<Ellipse Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BorderThicknessToStrokeThicknessConverter}}">
<Ellipse.Fill>
<VisualBrush Viewbox="{Binding Path=ViewBox, RelativeSource={RelativeSource TemplatedParent}}"
ViewboxUnits="Absolute"
Visual="{Binding Path=Target, RelativeSource={RelativeSource TemplatedParent}}"/>
</Ellipse.Fill>
</Ellipse>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>