Files
aistudio-wpf-diagram/AIStudio.Wpf.DiagramDesigner.Additionals/Controls/SliderRotation.xaml
2023-01-25 15:58:05 +08:00

39 lines
2.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.Additionals.Controls.SliderRotation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Name="sliderRotation"
Foreground="{DynamicResource Fluent.Ribbon.Brushes.AccentBaseColorBrush}" BorderBrush="{DynamicResource BlackBrush}" >
<Viewbox>
<Grid>
<Canvas Name="canvas" Width="80" Height="80" HorizontalAlignment="Center" VerticalAlignment="Center">
<Ellipse Height="80" Width="80" Name="ellipseBack"
Stroke="{x:Null}"
Fill="{Binding ElementName=sliderRotation, Path=BorderBrush}"
MouseLeave="ellipseBack_MouseLeave"
MouseMove="ellipseBack_MouseMove"
MouseLeftButtonUp="ellipseBack_MouseUp"
MouseLeftButtonDown="ellipseBack_MouseDown"
StrokeThickness="0.5">
<!--<Ellipse.Effect>-->
<!--Effect外部光圈-->
<!--
<DropShadowEffect Direction="270" Color="Black" Opacity="0.5" BlurRadius="3" ShadowDepth="1"/>
</Ellipse.Effect>-->
</Ellipse>
<Ellipse Height="20" Name="handle" Stroke="#20000000" Width="20" Fill="{Binding ElementName=sliderRotation, Path=Foreground}" RenderTransformOrigin="0.5,2"
IsHitTestVisible="False" Margin="30,0,0,0">
<Ellipse.RenderTransform>
<RotateTransform x:Name="rotate" Angle="{Binding ElementName=sliderRotation, Path=Value}"/>
<!--RotateTransform能够让某对象产生旋转变化根据中心点进行顺时针旋转或逆时针旋转。-->
</Ellipse.RenderTransform>
</Ellipse>
</Canvas>
</Grid>
</Viewbox>
</UserControl>