void InitializeDevices() { Devices = new ObservableCollection<PDUDeviceViewModel>(); if (Device.PDUGroupLogic == null) return; foreach (var groupDevice in Device.PDUGroupLogic.Devices) { var pduDeviceViewModel = new PDUDeviceViewModel(); pduDeviceViewModel.Initialize(groupDevice); Devices.Add(pduDeviceViewModel); } SelectedDevice = Devices.FirstOrDefault(); }
void OnAdd() { var pduDeviceViewModel = new PDUDeviceViewModel(); pduDeviceViewModel.Initialize(SelectedAvailableDevice.Device); Devices.Add(pduDeviceViewModel); InitializeAvailableDevices(); }