demo提交

This commit is contained in:
艾竹
2023-01-25 23:55:30 +08:00
parent b857151bdc
commit f11a4170d8
49 changed files with 1220 additions and 184 deletions

View File

@@ -0,0 +1,31 @@
using System;
using AIStudio.Wpf.DiagramDesigner;
using AIStudio.Wpf.DiagramDesigner.Models;
using AIStudio.Wpf.DiagramDesigner.Services;
namespace AIStudio.Wpf.DiagramDesigner
{
public class DefaultDesignerItemViewModel : DesignerItemViewModelBase
{
public DefaultDesignerItemViewModel() : base()
{
}
public DefaultDesignerItemViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
{
}
public DefaultDesignerItemViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
{
}
public override SelectableItemBase GetSerializableObject()
{
return new DesignerItemBase(this);
}
}
}

View File

@@ -43,8 +43,8 @@ namespace AIStudio.Wpf.DiagramDesigner
protected override void Init()
{
AddItemCommand = new SimpleCommand(ExecuteAddItemCommand);
ImageSwitchCommand = new SimpleCommand(ExecuteImageSwitchCommand);
AddItemCommand = new SimpleCommand(Command_Enable, ExecuteAddItemCommand);
ImageSwitchCommand = new SimpleCommand(Command_Enable, ExecuteImageSwitchCommand);
base.Init();

View File

@@ -141,7 +141,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{
get
{
return this._menuItemCommand ?? (this._menuItemCommand = new SimpleCommand(ExecuteMenuItemCommand));
return this._menuItemCommand ?? (this._menuItemCommand = new SimpleCommand(Command_Enable, ExecuteMenuItemCommand));
}
}

View File

@@ -93,8 +93,8 @@ namespace AIStudio.Wpf.DiagramDesigner
{
ShowRotate = false;
ShowArrow = false;
AddInputCommand = new SimpleCommand(para => ExecuteAddInput(para));
AddOutputCommand = new SimpleCommand(para => ExecuteAddOutput(para));
AddInputCommand = new SimpleCommand(Command_Enable, para => ExecuteAddInput(para));
AddOutputCommand = new SimpleCommand(Command_Enable, para => ExecuteAddOutput(para));
base.Init();
}

View File

@@ -69,7 +69,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{
get
{
return this._menuItemCommand ?? (this._menuItemCommand = new SimpleCommand(ExecuteMenuItemCommand));
return this._menuItemCommand ?? (this._menuItemCommand = new SimpleCommand(Command_Enable, ExecuteMenuItemCommand));
}
}

View File

@@ -87,7 +87,7 @@ namespace AIStudio.Wpf.DiagramDesigner
protected override void Init()
{
MenuItemCommand = new SimpleCommand(ExecuteMenuItemCommand);
MenuItemCommand = new SimpleCommand(Command_Enable, ExecuteMenuItemCommand);
base.Init();
this.ClearConnectors();