private void TogglePages(ImageButton button) { if (pActiveButton == null || pActiveButton.Name == button.Name) return; else { pActiveButton.ToggleActiveState(); button.ToggleActiveState(); pActiveButton = button; } }