mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
重新加载Item的bug修复
This commit is contained in:
@@ -71,47 +71,62 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return null;
|
||||
}
|
||||
|
||||
protected virtual void Init(IDiagramViewModel root, bool initNew)
|
||||
public virtual void Init(IDiagramViewModel root, bool initNew)
|
||||
{
|
||||
Root = root;
|
||||
|
||||
if (Root?.ColorViewModel != null)
|
||||
if (this.ColorViewModel == null)
|
||||
{
|
||||
this.ColorViewModel = CopyHelper.Mapper(Root.ColorViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ColorViewModel = _service.CopyDefaultColorViewModel();
|
||||
if (Root?.ColorViewModel != null)
|
||||
{
|
||||
this.ColorViewModel = CopyHelper.Mapper(Root.ColorViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ColorViewModel = _service.CopyDefaultColorViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
if (Root?.FontViewModel != null)
|
||||
if (this.FontViewModel == null)
|
||||
{
|
||||
this.FontViewModel = CopyHelper.Mapper(Root.FontViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.FontViewModel = _service.CopyDefaultFontViewModel();
|
||||
if (Root?.FontViewModel != null)
|
||||
{
|
||||
this.FontViewModel = CopyHelper.Mapper(Root.FontViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.FontViewModel = _service.CopyDefaultFontViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
if (Root?.ShapeViewModel != null)
|
||||
if (this.ShapeViewModel == null)
|
||||
{
|
||||
this.ShapeViewModel = CopyHelper.Mapper(Root.ShapeViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ShapeViewModel = _service.CopyDefaultShapeViewModel();
|
||||
if (Root?.ShapeViewModel != null)
|
||||
{
|
||||
this.ShapeViewModel = CopyHelper.Mapper(Root.ShapeViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ShapeViewModel = _service.CopyDefaultShapeViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
if (Root?.AnimationViewModel != null)
|
||||
if (this.AnimationViewModel == null)
|
||||
{
|
||||
this.AnimationViewModel = CopyHelper.Mapper(Root.AnimationViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AnimationViewModel = _service.CopyDefaultAnimationViewModel();
|
||||
if (Root?.AnimationViewModel != null)
|
||||
{
|
||||
this.AnimationViewModel = CopyHelper.Mapper(Root.AnimationViewModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AnimationViewModel = _service.CopyDefaultAnimationViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
LockObjectViewModel = new LockObjectViewModel();
|
||||
if (LockObjectViewModel == null)
|
||||
{
|
||||
LockObjectViewModel = new LockObjectViewModel();
|
||||
}
|
||||
|
||||
if (initNew)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user