private void MSContextMenu_RemovePressed() { if (this.CurrentModelSystem != null) { BooleanQuestionData question = new BooleanQuestionData(); var module = this.CurrentModelSystem; question.Question = "Are you sure that you want to remove the model system '" + module.Name + "'?"; question.OnSuccess = XTMFPage.ProjectSettingsPage; question.OnCancel = XTMFPage.ProjectSettingsPage; question.OnCancelData = null; question.OnSuccessData = module; question.Path = this.Path; question.Yes = new BooleanQuestionButton() { Header = "Delete Model System", Description = "Delete " + module.Name, Icon = this.RemoveIcon, Highlight = this.WarningRed }; question.No = new BooleanQuestionButton() { Header = "Cancel", Description = "Do not delete the Model System", Icon = this.CancelIcon, Highlight = SelectBlue }; this.XTMF.Navigate(XTMFPage.BooleanQuestionPage, question); } }
public void SetActive(object data) { var questionData = data as BooleanQuestionData; if (questionData == null) { if (data is BooleanQuestionResult) { var res = data as BooleanQuestionResult; if (res.Data is BooleanQuestionData) { questionData = res.Data as BooleanQuestionData; } } } if (questionData == null) { return; } SetupButton(this.SelectButton, questionData.Yes); SetupButton(this.CancelButton, questionData.No); this.Data = questionData; this.QuestionTextBox.Content = questionData.Question; int length; XTMFPage[] ourPath = new XTMFPage[(length = questionData.Path.Length) + 1]; for (int i = 0; i < length; i++) { ourPath[i] = questionData.Path[i]; } ourPath[length] = XTMFPage.QuestionPage; this.Path = ourPath; this.SelectButton.IsEnabled = true; }
public void SetActive(object data) { var questionData = data as BooleanQuestionData; if ( questionData == null ) { if ( data is BooleanQuestionResult ) { var res = data as BooleanQuestionResult; if ( res.Data is BooleanQuestionData ) { questionData = res.Data as BooleanQuestionData; } } } if ( questionData == null ) return; SetupButton( this.SelectButton, questionData.Yes ); SetupButton( this.CancelButton, questionData.No ); this.Data = questionData; this.QuestionTextBox.Content = questionData.Question; int length; XTMFPage[] ourPath = new XTMFPage[( length = questionData.Path.Length ) + 1]; for ( int i = 0; i < length; i++ ) { ourPath[i] = questionData.Path[i]; } ourPath[length] = XTMFPage.QuestionPage; this.Path = ourPath; this.SelectButton.IsEnabled = true; }
private void MSContextMenu_RemovePressed() { if ( this.CurrentModelSystem != null ) { BooleanQuestionData question = new BooleanQuestionData(); var module = this.CurrentModelSystem; question.Question = "Are you sure that you want to remove the model system '" + module.Name + "'?"; question.OnSuccess = XTMFPage.ProjectSettingsPage; question.OnCancel = XTMFPage.ProjectSettingsPage; question.OnCancelData = null; question.OnSuccessData = module; question.Path = this.Path; question.Yes = new BooleanQuestionButton() { Header = "Delete Model System", Description = "Delete " + module.Name, Icon = this.RemoveIcon, Highlight = this.WarningRed }; question.No = new BooleanQuestionButton() { Header = "Cancel", Description = "Do not delete the Model System", Icon = this.CancelIcon, Highlight = SelectBlue }; this.XTMF.Navigate( XTMFPage.BooleanQuestionPage, question ); } }