Are you per chance trying to switch views while a switch view is in progress? For example, you click the button, it switches the view, but the code behind the button tries to switch to another view?
This will cause the issue (or something similar to the one) you are seeing.