Files
serein-flow/WorkBench/Node/View/NodeControlBase.cs

62 lines
1.3 KiB
C#
Raw Normal View History

using Serein.Library.Api;
using Serein.Library.Entity;
using Serein.NodeFlow.Base;
using Serein.WorkBench.Node.ViewModel;
2024-08-05 10:11:58 +08:00
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Controls;
using System.Windows.Media;
namespace Serein.WorkBench.Node.View
{
/// <summary>
/// 节点控件基类(控件)
/// </summary>
public abstract class NodeControlBase : UserControl, IDynamicFlowNode
{
public NodeControlViewModelBase ViewModel { get; set; }
2024-08-05 10:11:58 +08:00
protected NodeControlBase()
2024-08-05 10:11:58 +08:00
{
this.Background = Brushes.Transparent;
}
protected NodeControlBase(NodeControlViewModelBase viewModelBase)
2024-08-05 10:11:58 +08:00
{
ViewModel = viewModelBase;
this.Background = Brushes.Transparent;
2024-08-05 10:11:58 +08:00
}
}
2024-08-05 10:11:58 +08:00
public class FLowNodeObObservableCollection<T> : ObservableCollection<T>
{
public void AddRange(IEnumerable<T> items)
{
foreach (var item in items)
{
this.Items.Add(item);
}
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add));
}
}
}