mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
为线的动画做扩展准备
This commit is contained in:
@@ -102,6 +102,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.ShapeViewModel = _service.CopyDefaultShapeViewModel();
|
||||
}
|
||||
|
||||
if (Root?.AnimationViewModel != null)
|
||||
{
|
||||
this.AnimationViewModel = CopyHelper.Mapper(Root.AnimationViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AnimationViewModel = _service.CopyDefaultAnimationViewModel();
|
||||
}
|
||||
|
||||
LockObjectViewModel = new LockObjectViewModel();
|
||||
|
||||
if (initNew)
|
||||
@@ -130,6 +139,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
ColorViewModel = CopyHelper.Mapper(designerbase.ColorItem);
|
||||
FontViewModel = CopyHelper.Mapper<FontViewModel, FontItem>(designerbase.FontItem);
|
||||
ShapeViewModel = CopyHelper.Mapper(designerbase.SharpItem);
|
||||
AnimationViewModel = CopyHelper.Mapper(designerbase.AnimationItem);
|
||||
}
|
||||
|
||||
public bool IsLoaded
|
||||
@@ -367,6 +377,27 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private IAnimationViewModel _animationViewModel;
|
||||
public IAnimationViewModel AnimationViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return _animationViewModel;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_animationViewModel != null)
|
||||
{
|
||||
_animationViewModel.PropertyChanged -= AnimationViewModel_PropertyChanged;
|
||||
}
|
||||
SetProperty(ref _animationViewModel, value);
|
||||
if (_animationViewModel != null)
|
||||
{
|
||||
_animationViewModel.PropertyChanged += AnimationViewModel_PropertyChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ILockObjectViewModel LockObjectViewModel
|
||||
{
|
||||
get; set;
|
||||
@@ -459,6 +490,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
RaisePropertyChanged(sender, e);
|
||||
}
|
||||
|
||||
protected void AnimationViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (IsLoaded == false) { return; }
|
||||
|
||||
RaisePropertyChanged(sender, e);
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Id}-{Name}-{Text}";
|
||||
|
||||
Reference in New Issue
Block a user