Files
BrightSharp.Toolkit/BrightSharp.NET/Themes/Controls/ZoomControl.xaml
Vitali Semianiaka 81af2d3c8c .net copy
2021-04-14 16:26:56 +03:00

38 lines
2.1 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:diag="clr-namespace:BrightSharp.Diagrams">
<Style TargetType="{x:Type diag:ZoomControl}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="ClipToBounds" Value="True" />
<Setter Property="Focusable" Value="False" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<Canvas Background="Transparent" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type diag:ZoomControl}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}">
<Grid>
<ItemsPresenter>
<ItemsPresenter.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding RenderZoom, RelativeSource={RelativeSource TemplatedParent}}"
ScaleY="{Binding ScaleX, RelativeSource={RelativeSource Self}}" />
<TranslateTransform X="{Binding TranslateX, RelativeSource={RelativeSource TemplatedParent}}"
Y="{Binding TranslateY, RelativeSource={RelativeSource TemplatedParent}}" />
</TransformGroup>
</ItemsPresenter.RenderTransform>
</ItemsPresenter>
<Border x:Name="PART_SelectionBorder" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>