private async Task LoadVirtualMachineDisksAsync() { try { IDiskCollection disks = await _virtualMachineDisksLoader.LoadVirtualMachineDisks(_virtualMachineNames[_selectedVirtualMachineIndex]); Disks = new DiskViewModelCollection(disks); } catch (Exception exception) { _errorDialogService.ShowErrorDialog(exception); } }
public MainWindowViewModel(IWindowCloseService closeDialogService, IConnectionDialogService connectionDialogService, IErrorDialogService errorDialogService, IVirtualMachineNamesLoader virtualMachineNamesLoader, IVirtualMachineDisksLoader virtualMachineDisksLoader, ICleanUpService cleanUpService) { _closeDialogService = closeDialogService; _connectionDialogService = connectionDialogService; _errorDialogService = errorDialogService; _virtualMachineNamesLoader = virtualMachineNamesLoader; _virtualMachineDisksLoader = virtualMachineDisksLoader; _cleanUpService = cleanUpService; _virtualMachineNames = _virtualMachineNamesStub; _disks = _disksStub; _closeCommand = new DelegateCommand(Close); _loadVirtualMachinesCommand = new DelegateCommand(LoadVirtualMachines); _loadVirtualMachineDisksCommand = new DelegateCommand(LoadVirtualMachineDisks, CanLoadVirtualMachineDisks); CancelClose = true; }