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 CanvasInfoViewModel : ObservableObject
{
private readonly FlowNodeService flowNodeService;
///
/// 画布数据实体
///
[ObservableProperty]
private FlowCanvasDetails _model;
public CanvasInfoViewModel(FlowNodeService flowNodeService)
{
this.flowNodeService = flowNodeService;
this.flowNodeService.OnViewCanvasChanged += OnViewCanvasChanged;
}
///
/// 查看的画布发生改变
///
///
private void OnViewCanvasChanged(FlowCanvasView flowCanvas)
{
Model = flowCanvas.ViewModel.Model;
}
}
}