Well if you're trying to switch to xray mode you have to be in shaded mode first, I can't think of any other reason.