private void OkNewHostDevice(object obj) { HostDevices.Add(new HostDevice { Name = NewHostDeviceInput }); NewHostDeviceInput = ""; SelectedHostDevice = HostDevices[HostDevices.Count - 1]; IsEditingNewHostDeviceName = false; }
private void DeleteHostDevice(HostDevice device) { int i = HostDevices.IndexOf(device); HostDevices.Remove(device); if (HostDevices.Count == 0) { SelectedHostDevice = null; } else { if (i == 0) { SelectedHostDevice = HostDevices[0]; } else { SelectedHostDevice = HostDevices[i - 1]; } } }