using System.Collections.ObjectModel;
|
using System.ComponentModel;
|
using System.Runtime.CompilerServices;
|
using System.Windows;
|
using System.Windows.Controls;
|
using HMI.Base;
|
using HMI.Core.Api;
|
using log4net;
|
|
namespace HMI.SettingControl
|
{
|
/// <summary>
|
/// UserControl1.xaml 的交互逻辑
|
/// </summary>
|
public partial class SettingControl : PluginControl
|
{
|
#region 属性
|
private ObservableCollection<TabItem> tabItems;
|
|
public ObservableCollection<TabItem> TabItems
|
{
|
get { return tabItems; }
|
set { Set(ref tabItems, value); }
|
}
|
#endregion
|
|
public SettingControl()
|
{
|
DataContext = this;
|
InitializeComponent();
|
}
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
{
|
TabItems = new ObservableCollection<TabItem>() {
|
new TabItem
|
{
|
Header = "系统设置",
|
Content = new SystemConfig()
|
}
|
};
|
foreach (var d in PluginLoader.Instance.Plugins)
|
{
|
if (d.SettingControl == null) continue;
|
TabItems.Add(new TabItem
|
{
|
Header = d.Name,
|
Tag = d,
|
Content = d.SettingControl
|
});
|
}
|
Loaded -= UserControl_Loaded;
|
}
|
}
|
}
|