private void OnAdd(object parameter) { switch (SelectedTab) { case 0: AuxiliaryApplication newAuxApp = new AuxiliaryApplication(); newAuxApp.Name = "New Auxiliary Application"; AuxiliaryApplicationViewModel newAuxAppViewModel = new AuxiliaryApplicationViewModel(newAuxApp, this); newAuxAppViewModel.StartRequest += OnAuxAppStartRequest; newAuxAppViewModel.StopRequest += OnAuxAppStopRequest; newAuxAppViewModel.CheckRunningRequest += OnAuxAppCheckRunRequest; newAuxAppViewModel.IsExpanded = true; AuxiliaryApplications.Add(newAuxAppViewModel); break; case 1: DriveMap newDriveMap = new DriveMap(@"\\computer\share", "Z"); DriveMapViewModel newDriveMapViewModel = new DriveMapViewModel(newDriveMap); DriveMaps.Add(newDriveMapViewModel); break; default: break; } }
private void OnAdd(object parameter) { AuxiliaryApplication newAuxApp = new AuxiliaryApplication(); newAuxApp.Name = "New Auxiliary Application"; AuxiliaryApplicationViewModel newAuxAppViewModel = new AuxiliaryApplicationViewModel(newAuxApp); newAuxAppViewModel.IsExpanded = true; AuxiliaryApplications.Add(newAuxAppViewModel); }
private void OnAdd(object parameter) { AuxiliaryApplication newAuxApp = new AuxiliaryApplication(); newAuxApp.Name = "New Auxiliary Application"; AuxiliaryApplicationViewModel newAuxAppViewModel = new AuxiliaryApplicationViewModel(newAuxApp, this); newAuxAppViewModel.StartRequest += OnAuxAppStartRequest; newAuxAppViewModel.StopRequest += OnAuxAppStopRequest; newAuxAppViewModel.CheckRunningRequest += OnAuxAppCheckRunRequest; newAuxAppViewModel.IsExpanded = true; AuxiliaryApplications.Add(newAuxAppViewModel); }
public SettingsWindowViewModel(Settings settings) { WorkingSettings = settings; AuxiliaryApplications = new ObservableCollection <AuxiliaryApplicationViewModel>(); WorkingSettings.AuxiliaryApplications.ForEach(x => { var auxApp = new AuxiliaryApplicationViewModel(x, this); auxApp.StartRequest += OnAuxAppStartRequest; auxApp.StopRequest += OnAuxAppStopRequest; auxApp.CheckRunningRequest += OnAuxAppCheckRunRequest; AuxiliaryApplications.Add(auxApp); }); if (AuxiliaryApplications.Count > 0) { AuxiliaryApplications[0].IsExpanded = true; } }
public SettingsWindowViewModel(Settings settings) { WorkingSettings = settings; AuxiliaryApplications = new ObservableCollection<AuxiliaryApplicationViewModel>(); WorkingSettings.AuxiliaryApplications.ForEach(x => { var auxApp = new AuxiliaryApplicationViewModel(x, this); auxApp.StartRequest += OnAuxAppStartRequest; auxApp.StopRequest += OnAuxAppStopRequest; auxApp.CheckRunningRequest += OnAuxAppCheckRunRequest; AuxiliaryApplications.Add(auxApp); }); if (AuxiliaryApplications.Count > 0) { AuxiliaryApplications[0].IsExpanded = true; } }