修改内部使用方法,不需要使用页面绑定的命令

This commit is contained in:
艾竹
2023-03-25 22:29:02 +08:00
parent 5e5da021ab
commit 90e94a7ec0
44 changed files with 337 additions and 435 deletions

View File

@@ -506,7 +506,7 @@ namespace AIStudio.Wpf.Mind.ViewModels
item.InitLayout(true);//因为节点的层级不同的样式所以需要Parent确定后才能初始化
ConnectionViewModel connector = MindLayout?.GetOrSetConnectionViewModel(this, item);
Root?.DirectAddItemCommand.Execute(new SelectableDesignerItemViewModelBase[] { item, connector });
Root?.Add(new SelectableDesignerItemViewModelBase[] { item, connector });
connector.ZIndex = -1;
connector.IsSelected = false;
item.IsSelected = false;
@@ -521,8 +521,8 @@ namespace AIStudio.Wpf.Mind.ViewModels
var connectors = Root?.Items.OfType<ConnectionViewModel>().Where(p => p.SinkConnectorInfoFully?.DataItem == item).ToList();
Root?.DirectRemoveItemCommand.Execute(item);
Root?.DirectRemoveItemCommand.Execute(connectors);
Root?.Remove(item);
Root?.Remove(connectors);
if (removeall)
{
@@ -545,8 +545,8 @@ namespace AIStudio.Wpf.Mind.ViewModels
}
var connectors = Root?.Items.OfType<ConnectionViewModel>().Where(p => p.SinkConnectorInfoFully?.DataItem == this).ToList();
Root?.DirectRemoveItemCommand.Execute(this);
Root?.DirectRemoveItemCommand.Execute(connectors);
Root?.Remove(this);
Root?.Remove(connectors);
if (removeall)
{
@@ -570,7 +570,7 @@ namespace AIStudio.Wpf.Mind.ViewModels
else if (ParentNode != null)
{
connector = MindLayout?.GetOrSetConnectionViewModel(ParentNode, this, null);
Root?.DirectAddItemCommand.Execute(new SelectableDesignerItemViewModelBase[] { connector });
Root?.Add(new SelectableDesignerItemViewModelBase[] { connector });
connector.ZIndex = -1;
connector.IsSelected = false;
}