mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-31 21:46:34 +08:00
优化了Workbench上的操作。
This commit is contained in:
41
Workbench/ViewModels/ViewCanvasInfoViewModel.cs
Normal file
41
Workbench/ViewModels/ViewCanvasInfoViewModel.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Serein.Library;
|
||||
using Serein.Workbench.Services;
|
||||
using Serein.Workbench.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Workbench.ViewModels
|
||||
{
|
||||
internal partial class ViewCanvasInfoViewModel : ObservableObject
|
||||
{
|
||||
private readonly FlowNodeService flowNodeService;
|
||||
|
||||
/// <summary>
|
||||
/// 画布数据实体
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private FlowCanvasDetails _model;
|
||||
|
||||
public ViewCanvasInfoViewModel(FlowNodeService flowNodeService)
|
||||
{
|
||||
this.flowNodeService = flowNodeService;
|
||||
this.flowNodeService.OnViewCanvasChanged += OnViewCanvasChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查看的画布发生改变
|
||||
/// </summary>
|
||||
/// <param name="flowCanvas"></param>
|
||||
private void OnViewCanvasChanged(FlowCanvasView flowCanvas)
|
||||
{
|
||||
Model = flowCanvas.ViewModel.Model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user