using System; using System.Collections.Generic; using System.Linq; using System.Text; using Aitex.Core.RT.Event; using Aitex.Core.UI.MVVM; using Aitex.Core.UI.View.Common; using Aitex.Triton160.Common; using Aitex.Triton160.UI; using Aitex.Triton160.UI.ViewModel; namespace Triton160.UI.ViewModel { class JetEventViewModel : UIViewModelBase { string AlarmEventParam = ModuleNameString.System + "." + StateData.AlarmEvent.ToString(); public MonitorViewModel MonitorVM { get; set; } public EventViewModel EventVM { get; set; } public JetEventViewModel() : base("JetEventViewModel") { MonitorVM = new MonitorViewModel(); EventVM = new EventViewModel(); Subscribe(AlarmEventParam); EventVM.QueryDBEventFunc = (sql) => Triton160UiSystem.Instance.WCF.Query.QueryDBEvent(sql); EventVM.QueryEventList = () => { List result = new List(); foreach (var eventName in Enum.GetNames(typeof(EventEnum))) result.Add(eventName); return result; }; } protected override void InvokeBeforeUpdateProperty(Dictionary data) { if (data.ContainsKey(AlarmEventParam)) MonitorVM.UpdateAlarmEvent((List)data[AlarmEventParam]); } } }