mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
block demo 已经完成到第三个了
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -469,23 +469,35 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public async Task Execute()
|
||||
{
|
||||
await BeforeExecute();
|
||||
await Executing();
|
||||
await AfterExecute();
|
||||
await StopExecution();
|
||||
await BeforeExecution();
|
||||
if (await Executing())
|
||||
{
|
||||
await AfterExecution();
|
||||
}
|
||||
else
|
||||
{
|
||||
IsExecuting = false;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Task BeforeExecute()
|
||||
public virtual Task BeforeExecution()
|
||||
{
|
||||
IsExecuting = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task Executing()
|
||||
public virtual Task<bool> Executing()
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public virtual Task StopExecution()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual async Task AfterExecute()
|
||||
public virtual async Task AfterExecution()
|
||||
{
|
||||
if (IsExecuting)
|
||||
{
|
||||
|
||||
@@ -41,10 +41,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get;
|
||||
}
|
||||
ICommand NextCommand
|
||||
{
|
||||
get;
|
||||
}
|
||||
ICommand AlignTopCommand
|
||||
{
|
||||
get;
|
||||
@@ -340,6 +336,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
void Delete(object parameter);
|
||||
|
||||
bool Next();
|
||||
|
||||
void ClearSelectedItems();
|
||||
|
||||
bool ExecuteShortcut(KeyEventArgs e);
|
||||
|
||||
Reference in New Issue
Block a user