public ImitatorViewModel() { Current = this; Title = "Имитатор состояний устройств"; Devices = new ObservableCollection<DeviceViewModel>(); foreach (var device in ConfigurationCash.DeviceConfiguration.Devices) { if (device.Driver.DriverType == DriverType.IndicationBlock) continue; if (device.Driver.DriverType == DriverType.Page) continue; if (device.Driver.DriverType == DriverType.Indicator) continue; var deviceViewModel = new DeviceViewModel(device.DeviceState); Devices.Add(deviceViewModel); } if (Watcher.Current != null) { Watcher.Current.DevicesStateChanged += new System.Action<List<FiresecAPI.Models.DeviceState>>(OnDevicesStateChanged); } }
public static void Show() { var imitatorViewModel = new ImitatorViewModel(); DialogService.ShowWindow(imitatorViewModel); }