jeudi 28 mai 2015

How and Why is this If condition satisfying when value is false in C#

I have this strange problem in Windows Phone Application. Hitting hardware Back button exits the application when it should have shown the previous page. While debugging, I found something really strange.

If Condition satisfied for false

In this method, this.Frame is Not null (as shown in 3rd pin) but this.Frame.CanGoBack is False (as shown in 1st pin) which means the && (Bit wise AND) operator should make this condition as false and it does (as shown in the second Pin). Still debugger stepped in the condition to execute(as you can see below second pin).

This is really strange and This only exits my application.

Aucun commentaire:

Enregistrer un commentaire