// Global Type Handler private void GlobalButtonTypeClick(NWButton btnTypeButton, G__MathType _mathType) { // Turn off the old button NWButton tmpBtnViewOld = this.View.ViewWithTag(intTypeHoldState) as NWButton; if (tmpBtnViewOld != null) { tmpBtnViewOld.ApplyUIUnHeld(); } // Handle toggle functionality if (this.intTypeHoldState == btnTypeButton.Tag) { this.intTypeHoldState = 0; _mathType = G__MathType.All; } else { this.intTypeHoldState = btnTypeButton.Tag; btnTypeButton.HoldState = true; } // Set the viewmodel/repo filter this._vmLesson.FilterMathType = _mathType; // Refresh/re-query the view this.LoadLessonsFilteredAsync(); }
// Global Level Handler private void GlobalButtonOpClick(NWButton btnOpButton, G__MathOperator _mathOperator) { // Turn off the old button NWButton tmpBtnViewOld = this.View.ViewWithTag(intOpHoldState) as NWButton; if (tmpBtnViewOld != null) { tmpBtnViewOld.ApplyUIUnHeld(); } // If - handle toggle functionality if the button is the same // Else - set the new button state if (this.intOpHoldState == btnOpButton.Tag) { this.intOpHoldState = 0; _mathOperator = G__MathOperator.All; } else { this.intOpHoldState = btnOpButton.Tag; btnOpButton.HoldState = true; } this._vmLesson.FilterMathOperator = _mathOperator; // Refresh/re-query the view this.LoadLessonsFilteredAsync(); }