mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-20 00:16:36 +08:00
思维导图修改成回车新增子节点
This commit is contained in:
@@ -150,5 +150,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get; set;
|
||||
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.Alt | e.Key == Key.A;
|
||||
|
||||
[Description("Next Node (CEnter by default)")]
|
||||
public Func<KeyEventArgs, bool> Next
|
||||
{
|
||||
get; set;
|
||||
} = e => e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Enter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
@@ -735,6 +736,15 @@ 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
|
||||
{
|
||||
@@ -1511,6 +1521,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ExecuteNextCommand(object parameter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ExecuteSelectAllCommand(object parameter)
|
||||
{
|
||||
List<SelectableDesignerItemViewModelBase> selectedItems = Items.ToList();
|
||||
@@ -3146,7 +3161,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
ReplaceAllCommand.Execute(new object[] { SearchText, ReplaceText });
|
||||
return true;
|
||||
}
|
||||
|
||||
else if (DiagramOption.ShortcutOption.Next(e))
|
||||
{
|
||||
NextCommand.Execute(null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -44,10 +44,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
protected override void Init(IDiagramViewModel root, bool initNew)
|
||||
{
|
||||
base.Init(root, initNew);
|
||||
|
||||
SelectItemCommand = new SimpleCommand(Command_Enable, ExecuteSelectItemCommand);
|
||||
EditCommand = new SimpleCommand(Command_Enable, ExecuteEditCommand);
|
||||
base.Init(root, initNew);
|
||||
}
|
||||
|
||||
protected override void InitNew()
|
||||
@@ -69,13 +66,31 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return true;
|
||||
}
|
||||
|
||||
private ICommand _selectItemCommand;
|
||||
public ICommand SelectItemCommand
|
||||
{
|
||||
get; private set;
|
||||
get
|
||||
{
|
||||
return this._editCommand ?? (this._editCommand = new SimpleCommand(Command_Enable, ExecuteSelectItemCommand));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _editCommand;
|
||||
public ICommand EditCommand
|
||||
{
|
||||
get; private set;
|
||||
get
|
||||
{
|
||||
return this._editCommand ?? (this._editCommand = new SimpleCommand(Command_Enable, ExecuteEditCommand));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _exitEditCommand;
|
||||
public ICommand ExitEditCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._exitEditCommand ?? (this._exitEditCommand = new SimpleCommand(Command_Enable, ExecuteExitEditCommand));
|
||||
}
|
||||
}
|
||||
|
||||
private bool enabledForSelection = true;
|
||||
@@ -162,6 +177,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (IsReadOnly == true) return;
|
||||
|
||||
ShowText = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void ExecuteExitEditCommand(object param)
|
||||
{
|
||||
IsSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user