The code for switching the button state is working fine but the code where I want to trigger the action is not.

location.State == TouchLocationState.Released mostly ends up being false.
(Even after I release the touch, it has a value of TouchLocationState.Moved)
And what is more irritating is that it sometimes works!

I am really confused and stuck for days now. Is this the right way? If yes then where am I going wrong? Or is there some other more effective way to do this?

PS: I also posted this question on stack overflow then realized this question is more appropriate in gamedev. Sorry if it counts as being redundant.

You posted a lot of code. What exactly did you change to fix this? You should at least describe that in your answer.
–
ashes999Sep 8 '13 at 16:03

You should also check if _selectedButton == null instead of try/catch (which can have horrible performance implications), and you should put if bracket statements in curly braces if (condition) { ... } else { ... }
–
ashes999Sep 8 '13 at 16:05