为线的动画做扩展准备

This commit is contained in:
艾竹
2023-04-29 15:29:22 +08:00
parent 7d8b19e4e0
commit f4268b9fc2
23 changed files with 397 additions and 120 deletions

View File

@@ -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}";