private void Execut_LoadActiveProfile() { View.LoadProfileDialog newDialog = new View.LoadProfileDialog(); LoadProfileDiagViewModel diagVM = new LoadProfileDiagViewModel(newDialog); newDialog.DataContext = diagVM; if (newDialog.ShowDialog() == true && diagVM.ProfilList_SelectedIndex >= 0) { this.ActiveProfile = Profile.LoadProfileFromFile(diagVM.ProfileList[diagVM.ProfilList_SelectedIndex]); } }
private void Execute_LoadProfile() { View.LoadProfileDialog newDialog = new View.LoadProfileDialog(); LoadProfileDiagViewModel diagVM = new LoadProfileDiagViewModel(newDialog); newDialog.DataContext = diagVM; if (newDialog.ShowDialog() == true && diagVM.ProfilList_SelectedIndex >= 0) { this.CPmodel.LoadProfile(diagVM.ProfileList[diagVM.ProfilList_SelectedIndex]); this.RefreshView(); } }
private void Execute_DialogCancel(View.LoadProfileDialog dialog) { dialog.DialogResult = false; }
private void Execute_DialogLoad(View.LoadProfileDialog dialog) { dialog.DialogResult = true; }
public LoadProfileDiagViewModel(View.LoadProfileDialog newDialog) { this.Command_DialogLoad = new DelegateCommand(x => this.Execute_DialogLoad(newDialog)); this.Command_DialogCancel = new DelegateCommand(x => this.Execute_DialogCancel(newDialog)); this.ProfilList_SelectedIndex = -1; }