using parkMonitor.viewModel;
using parkMonitor.viewModel.devInfoPanel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace parkMonitor.model {
	/// <summary>UI操作接口</summary>
	public class UIFace {
		public static UIFace ins = new UIFace();

		/// <summary>转到ui线程</summary>
		public void syncCtl(Action fun) {
			mainWin.Dispatcher.Invoke(fun);
		}

		/// <summary>转到ui线程</summary>
		public void syncCtl(Action<object> fun, object data) {
			mainWin.Dispatcher.Invoke(fun, data);
		}

		/// <summary>主窗口</summary>
		public MainWindow mainWin { get { return MainModel.ins.mainWin; } }
		/// <summary>主窗口ViewModel</summary>
		public MainWinVM mainWinVM { get { return MainModel.ins.mainWinVM; } }

		/// <summary>cpu</summary>
		public int? cpu {
			get { return mainWinVM.panel.CentralStatus.cpuNum; }
			set { mainWinVM.panel.CentralStatus.cpuNum = value; }
		}

		/// <summary>内存</summary>
		public int? mem {
			get { return mainWinVM.panel.CentralStatus.memNum; }
			set { mainWinVM.panel.CentralStatus.memNum = value; }
		}

	}
}
