using parkMonitor.viewModel.alarm;
using parkMonitor.viewModel.detail;
using parkMonitor.viewModel.devInfoPanel;
using parkMonitor.viewModel.objectTree;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace parkMonitor.viewModel {
	/// <summary>主窗口ViewModel</summary>
	public class MainWinVM : INotifyPropertyChanged {
		public MainWinVM() {
			LstObjectTree = new ObjectTreeVM();
			panel = new MonitorPanelVM();
			DevMenuItems = new DevMenuItemVMCtl();
		}
		//设备树形结构
		public ObjectTreeVM LstObjectTree { get; private set; }
		//public ObservableCollection<ObjectTreeRootVM> LstObjectTree { get { return objectTreeVMCtl.lstData; } }

		//树形列表-是否显示列表模式
		bool _IsDevTreeShowList = false;
		public bool IsDevTreeShowList {
			get { return _IsDevTreeShowList; }
			set { _IsDevTreeShowList = value; FirePropertyChanged("IsDevTreeShowList"); }
		}

		//监控面板
		//MonitorPanelVM _panel = new MonitorPanelVM();
		public MonitorPanelVM panel { get; private set; }

		//设备菜单项
		//DevMenuItemVMCtl _DevMenuItems = new DevMenuItemVMCtl();
		public DevMenuItemVMCtl DevMenuItems { get; private set; }

		//详细信息ViewModel
		ObservableCollection<DevDetailItemVM> _DevInfoDetail = new ObservableCollection<DevDetailItemVM>();
		public ObservableCollection<DevDetailItemVM> DevInfoDetail {
			get { return _DevInfoDetail; }
			set { _DevInfoDetail = value; FirePropertyChanged("DevInfoDetail"); }
		}

		//报警信息ViewModel
		//ObservableCollection<AlarmItemVM> _AlarmInfo = new ObservableCollection<AlarmItemVM>();
		//public ObservableCollection<AlarmItemVM> AlarmInfo {
		//	get { return _AlarmInfo; }
		//	set { _AlarmInfo = value; FirePropertyChanged("AlarmInfo"); }
		//}

		//日志信息
		string _LogInfo = "";
		public string LogInfo {
			get { return _LogInfo; }
			set { _LogInfo = value; FirePropertyChanged("LogInfo"); }
		}

		public virtual event PropertyChangedEventHandler PropertyChanged;
		public virtual void FirePropertyChanged(string propertyName) {
			if(PropertyChanged != null) {
				PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
