mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-11 12:10:47 +08:00
新增了UI节点
This commit is contained in:
40
Workbench/Node/ViewModel/UINodeControlViewModel.cs
Normal file
40
Workbench/Node/ViewModel/UINodeControlViewModel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using Serein.NodeFlow.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Serein.Workbench.Node.ViewModel
|
||||
{
|
||||
public class UINodeControlViewModel : NodeControlViewModelBase
|
||||
{
|
||||
private SingleUINode NodeModel => (SingleUINode)base.NodeModel;
|
||||
//public IEmbeddedContent Adapter => NodeModel.Adapter;
|
||||
|
||||
public UINodeControlViewModel(NodeModelBase nodeModel) : base(nodeModel)
|
||||
{
|
||||
//NodeModel.Adapter.GetWindowHandle();
|
||||
}
|
||||
|
||||
public void InitAdapter(Action<UserControl> setUIDisplayHandle)
|
||||
{
|
||||
Task.Factory.StartNew(async () =>
|
||||
{
|
||||
var context = new DynamicContext(NodeModel.Env);
|
||||
await NodeModel.ExecutingAsync(context);
|
||||
if (context.NextOrientation == ConnectionInvokeType.IsSucceed
|
||||
&& NodeModel.Adapter.GetUserControl() is UserControl userControl)
|
||||
{
|
||||
NodeModel.Env.UIContextOperation.Invoke(() =>
|
||||
{
|
||||
setUIDisplayHandle.Invoke(userControl);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user