Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

If or if / else if BUG Xamarin Android

VetaLioSTVVetaLioSTV USMember ✭✭
edited December 2015 in Xamarin.Android

Hello everyone.
In my override method OnTouch, on MotionEventActions.Move case,i use if / else if condition to do some stuff.
And the problem is,that sometimes (!) when condition "true",system doesn't enter there. I cant understand why that happens?(it's strange behaviour ,some kind of bug).

PS I think that occurs,because too many entries in "Move" case or something like that(but how to do workaround?)

Answers

  • UtkuGKCANUtkuGKCAN USMember
    edited January 2017

    I have similar situation, in Command which exists in my ViewModel, I have following code:

    public ICommand LogIn
        {
            get
            {
                if (Current.Username == "a")
                {
    
                    return new Command(() => Message = "Username Changed");
                }
                else
                {
                    return new Command(() => Message = "Invalid User!");
                }
            }
        }
    

    In debug, system says this condition is true, but it terminates statement in else.

  • VetaLioSTVVetaLioSTV USMember ✭✭

    @utkugokcan said:
    I have similar situation, in Command which exists in my ViewModel, I have following code:

    public ICommand LogIn
    {
    get
    {
    if (Current.Username == "a")
    {

                    return new Command(() => Message = "Username Changed");
                }
                else
                {
                    return new Command(() => Message = "Invalid User!");
                }
            }
        }
    

    In debug, system says this condition is true, but it terminates statement in else.

    Unfortunately I do not remember what was done to workaround that problem(but,i know that worked fine).

Sign In or Register to comment.