using CapMachine.Core; using CapMachine.Wpf.Models; using CapMachine.Wpf.PrismEvent; using Prism.Events; namespace CapMachine.Wpf.ViewModels { public class MonitorViewModel : NavigationViewModel { public MonitorViewModel(IEventAggregator eventAggregator) { //事件服务 _EventAggregator = eventAggregator; _EventAggregator.GetEvent().Subscribe(GetChartRtEvent); } private IEventAggregator _EventAggregator { get; set; } public List ListChartRtValue { get; set; } = new List() { new ChartRtValue(){ Name="温度",Value=12.3,Unit="℃"}, new ChartRtValue(){ Name="压力",Value=12.3,Unit="bar"}, new ChartRtValue(){ Name="湿度",Value=12.3,Unit="%"}, }; /// /// 获取曲线的实时值 /// 数据是发布过来 /// /// /// private void GetChartRtEvent(List RtData) { //ListChartRtValue = RtData; } } }