block demo 已经完成到第三个了

This commit is contained in:
艾竹
2023-08-13 11:36:47 +08:00
parent 9485ce6684
commit d68fe22a05
7 changed files with 46 additions and 36 deletions

View File

@@ -70,7 +70,7 @@ namespace AIStudio.Wpf.DiagramDesigner
foreach (var child in designer.Children)
{
BlockDesignerItemViewModel fullyCreatedConnectorInfo = new BlockDesignerItemViewModel(this.Root, child);
InsertChild(fullyCreatedConnectorInfo);
InsertChild(fullyCreatedConnectorInfo, -1);
}
}
}
@@ -273,16 +273,17 @@ namespace AIStudio.Wpf.DiagramDesigner
return double.IsNaN(ItemHeight) ? ActualItemHeight : ItemHeight;
}
public void InsertChild(BlockDesignerItemViewModel child)
{
child.ParentContainer = this;
Children.Add(child);
}
public void InsertChild(BlockDesignerItemViewModel child, int index)
{
child.ParentContainer = this;
Children.Insert(index, child);
if (index == -1)
{
Children.Add(child);
}
else
{
Children.Insert(index, child);
}
}
public void RemoveChild(BlockDesignerItemViewModel child)

View File

@@ -392,15 +392,6 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
private ICommand _nextCommand;
public ICommand NextCommand
{
get
{
return this._nextCommand ?? (this._nextCommand = new SimpleCommand(ExecuteEnable, ExecuteNextCommand));
}
}
private ICommand _alignTopCommand;
public ICommand AlignTopCommand
{
@@ -1067,10 +1058,10 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
public virtual void ExecuteNextCommand(object parameter)
public virtual bool Next()
{
}
return false;
}
private void ExecuteSelectAllCommand(object parameter)
{
@@ -2777,8 +2768,8 @@ namespace AIStudio.Wpf.DiagramDesigner
}
else if (DiagramOption.ShortcutOption.Next(e))
{
NextCommand.Execute(null);
return true;
//NextCommand.Execute(null);
return Next();
}
return false;
}