mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 08:10:50 +08:00
线条动画支持大小切换
This commit is contained in:
@@ -6,17 +6,17 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
[Serializable]
|
||||
public class AnimationViewModel : BindableBase, IAnimationViewModel
|
||||
{
|
||||
private LineAnimation _lineAnimation = LineAnimation.None;
|
||||
private LineAnimation _animation = LineAnimation.None;
|
||||
[CanDo]
|
||||
public LineAnimation LineAnimation
|
||||
public LineAnimation Animation
|
||||
{
|
||||
get
|
||||
{
|
||||
return _lineAnimation;
|
||||
return _animation;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _lineAnimation, value);
|
||||
SetProperty(ref _animation, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
SetProperty(ref _duration, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Color _color = Colors.Red;
|
||||
[CanDo]
|
||||
@@ -51,45 +51,39 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private string _path = "M 10,20 A 20,20 0 1 1 50,20 A 20,20 0 1 1 10,20";
|
||||
[CanDo]
|
||||
public string Path
|
||||
private ISharpPath _animationPath = SharpPath.Circle;
|
||||
public ISharpPath AnimationPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path;
|
||||
return _animationPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _path, value);
|
||||
if (_animationPath != value)
|
||||
{
|
||||
if (_animationPath != null && _animationPath is SharpPath _sharpPath1)
|
||||
{
|
||||
_sharpPath1.PropertyChanged -= AnimationViewModel_PropertyChanged;
|
||||
}
|
||||
SetProperty(ref _animationPath, value);
|
||||
if (_animationPath != null && _animationPath is SharpPath _sharpPath2)
|
||||
{
|
||||
_sharpPath2.PropertyChanged += AnimationViewModel_PropertyChanged;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RaisePropertyChanged(nameof(AnimationPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double _witdh;
|
||||
[CanDo]
|
||||
public double Width
|
||||
private void AnimationViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
get
|
||||
if (sender == AnimationPath)
|
||||
{
|
||||
return _witdh;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _witdh, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _height;
|
||||
[CanDo]
|
||||
public double Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _height, value);
|
||||
RaisePropertyChanged(nameof(AnimationPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user