mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-02 15:50:47 +08:00
修改环境接口(增加画布ID)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>True</UseWPF>
|
||||
<BaseOutputPath>D:\Project\C#\DynamicControl\SereinFlow\.Output</BaseOutputPath>
|
||||
<BaseOutputPath>..\.\.Output</BaseOutputPath>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<!--<IsRoslynComponent>true</IsRoslynComponent>-->
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Serein.Workbench.Services
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 向运行环境发出请求
|
||||
@@ -128,10 +128,13 @@ namespace Serein.Workbench.Services
|
||||
/// <returns></returns>
|
||||
public void CreateFlowCanvas()
|
||||
{
|
||||
string canvasName = "";
|
||||
int height = 1000;
|
||||
int width = 600;
|
||||
_ = flowEnvironment.CreateCanvasAsync(canvasName, width, height);
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
var result = await flowEnvironment.CreateCanvasAsync("", width, height);
|
||||
Console.WriteLine(result.Guid);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace Serein.Workbench.ViewModels
|
||||
[ObservableProperty]
|
||||
private FlowCanvasModel _selectedTab;
|
||||
|
||||
private int _addCount = 0;
|
||||
private readonly FlowNodeService flowNodeService;
|
||||
|
||||
public FlowEditViewModel(FlowNodeService flowNodeService)
|
||||
@@ -37,8 +36,8 @@ namespace Serein.Workbench.ViewModels
|
||||
AddTabCommand = new RelayCommand(AddTab);
|
||||
RemoveTabCommand = new RelayCommand(RemoveTab, CanRemoveTab);
|
||||
|
||||
flowNodeService.OnCreateFlowCanvasView += OnCreateFlowCanvasView; // 环境创建了节点
|
||||
flowNodeService.OnRemoveFlowCanvasView += OnRemoveFlowCanvasView;
|
||||
flowNodeService.OnCreateFlowCanvasView += OnCreateFlowCanvasView; // 运行环境创建了画布
|
||||
flowNodeService.OnRemoveFlowCanvasView += OnRemoveFlowCanvasView; // 运行环境移除了画布
|
||||
this.PropertyChanged += OnPropertyChanged;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace Serein.Workbench.ViewModels
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<FlowLibraryInfo> flowLibraryInfos;
|
||||
|
||||
|
||||
|
||||
public FlowLibrarysViewModel(IFlowEEForwardingService flowEEForwardingService)
|
||||
{
|
||||
this.flowEEForwardingService = flowEEForwardingService;
|
||||
|
||||
@@ -14,8 +14,6 @@ namespace Serein.Workbench.ViewModels
|
||||
{
|
||||
private readonly IFlowEEForwardingService flowEEForwardingService;
|
||||
|
||||
|
||||
|
||||
public FlowWorkbenchViewModel(IFlowEEForwardingService flowEEForwardingService)
|
||||
{
|
||||
this.flowEEForwardingService = flowEEForwardingService;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Serein.Workbench.Views
|
||||
/// </summary>
|
||||
public partial class FlowCanvasView : UserControl
|
||||
{
|
||||
public FlowCanvasViewModel ViewModel => ViewModel as FlowCanvasViewModel;
|
||||
public FlowCanvasViewModel ViewModel => this.DataContext as FlowCanvasViewModel;
|
||||
/// <summary>
|
||||
/// 存储所有的连接。考虑集成在运行环境中。
|
||||
/// </summary>
|
||||
@@ -89,8 +89,8 @@ namespace Serein.Workbench.Views
|
||||
private IFlowEnvironment EnvDecorator;
|
||||
public FlowCanvasView()
|
||||
{
|
||||
ViewModel = App.GetService<Locator>().FlowCanvasViewModel;
|
||||
this.DataContext = ViewModel;
|
||||
var vm = App.GetService<Locator>().FlowCanvasViewModel;
|
||||
this.DataContext = vm;
|
||||
EnvDecorator = App.GetService<IFlowEnvironment>();
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user