2025-05-27 23:46:06 +08:00
|
|
|
|
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
|
|
|
|
|
|
{
|
2025-05-30 23:31:31 +08:00
|
|
|
|
internal partial class ViewCanvasInfoViewModel : ObservableObject
|
2025-05-27 23:46:06 +08:00
|
|
|
|
{
|
|
|
|
|
|
private readonly FlowNodeService flowNodeService;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 画布数据实体
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
|
private FlowCanvasDetails _model;
|
|
|
|
|
|
|
2025-05-30 23:31:31 +08:00
|
|
|
|
public ViewCanvasInfoViewModel(FlowNodeService flowNodeService)
|
2025-05-27 23:46:06 +08:00
|
|
|
|
{
|
|
|
|
|
|
this.flowNodeService = flowNodeService;
|
|
|
|
|
|
this.flowNodeService.OnViewCanvasChanged += OnViewCanvasChanged;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查看的画布发生改变
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="flowCanvas"></param>
|
|
|
|
|
|
private void OnViewCanvasChanged(FlowCanvasView flowCanvas)
|
|
|
|
|
|
{
|
2025-05-30 01:02:25 +08:00
|
|
|
|
Model = flowCanvas.ViewModel.Model;
|
2025-05-27 23:46:06 +08:00
|
|
|
|
}
|
2025-05-30 23:31:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-27 23:46:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|