Added ImageCropper
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Toolkit.UI.Controls.Avalonia">
|
||||
<ControlTheme x:Key="ImageCropperThumbStyle" TargetType="Thumb">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="{DynamicResource SliderThumbBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SliderThumbBorderBrush}" />
|
||||
<Setter Property="ClipToBounds" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
Margin="-2"
|
||||
Background="{DynamicResource SliderOuterThumbBackground}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{DynamicResource SliderThumbCornerRadius}">
|
||||
<Ellipse
|
||||
Name="SliderInnerThumb"
|
||||
Width="{DynamicResource SliderInnerThumbWidth}"
|
||||
Height="{DynamicResource SliderInnerThumbHeight}"
|
||||
Fill="{TemplateBinding Background}"
|
||||
RenderTransform="scaleX(0.86) scaleY(0.86)">
|
||||
<Ellipse.Transitions>
|
||||
<Transitions>
|
||||
<TransformOperationsTransition
|
||||
Easing="0,0 0,1"
|
||||
Property="RenderTransform"
|
||||
Duration="00:00:00.167" />
|
||||
</Transitions>
|
||||
</Ellipse.Transitions>
|
||||
</Ellipse>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ Ellipse#SliderInnerThumb">
|
||||
<Setter Property="RenderTransform" Value="scaleX(1.167) scaleY(1.167)" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Ellipse#SliderInnerThumb">
|
||||
<Setter Property="RenderTransform" Value="scaleX(0.71) scaleY(0.71)" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ Ellipse#SliderInnerThumb">
|
||||
<Setter Property="RenderTransform" Value="scaleX(1.167) scaleY(1.167)" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
<ControlTheme x:Key="{x:Type ImageCropper}" TargetType="ImageCropper">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Canvas x:Name="Canvas">
|
||||
<Rectangle
|
||||
x:Name="RectangleLeft"
|
||||
Fill="{DynamicResource SmokeFillColorDefaultBrush}"
|
||||
UseLayoutRounding="True" />
|
||||
<Rectangle
|
||||
x:Name="RectangleTop"
|
||||
Fill="{DynamicResource SmokeFillColorDefaultBrush}"
|
||||
UseLayoutRounding="True" />
|
||||
<Rectangle
|
||||
x:Name="RectangleRight"
|
||||
Fill="{DynamicResource SmokeFillColorDefaultBrush}"
|
||||
UseLayoutRounding="True" />
|
||||
<Rectangle
|
||||
x:Name="RectangleBottom"
|
||||
Fill="{DynamicResource SmokeFillColorDefaultBrush}"
|
||||
UseLayoutRounding="True" />
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="2"
|
||||
Cursor="SizeAll" />
|
||||
<Thumb
|
||||
x:Name="TopLeftButton"
|
||||
Width="{DynamicResource SliderVerticalThumbWidth}"
|
||||
Height="{DynamicResource SliderVerticalThumbHeight}"
|
||||
Theme="{StaticResource ImageCropperThumbStyle}" />
|
||||
<Thumb
|
||||
x:Name="TopRightButton"
|
||||
Width="{DynamicResource SliderVerticalThumbWidth}"
|
||||
Height="{DynamicResource SliderVerticalThumbHeight}"
|
||||
Theme="{StaticResource ImageCropperThumbStyle}" />
|
||||
<Thumb
|
||||
x:Name="BottomLeftButton"
|
||||
Width="{DynamicResource SliderVerticalThumbWidth}"
|
||||
Height="{DynamicResource SliderVerticalThumbHeight}"
|
||||
Theme="{StaticResource ImageCropperThumbStyle}" />
|
||||
<Thumb
|
||||
x:Name="BottomRightButton"
|
||||
Width="{DynamicResource SliderVerticalThumbWidth}"
|
||||
Height="{DynamicResource SliderVerticalThumbHeight}"
|
||||
Theme="{StaticResource ImageCropperThumbStyle}" />
|
||||
</Canvas>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user