Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Device.StartTimer doesn't stop

$
0
0

It appears I may have the problem of it not deploying the updated code to the iPAD. I have seen this before.

Hi,
I have the following code snippet in the .cs of my xaml page.

  public ConectingXamlPage()
    {
        InitializeComponent();

        DependencyService.Get<INetScan>().NetScan();

        Device.StartTimer(TimeSpan.FromSeconds(1), () =>
        {
            if (DependencyService.Get<INetScan>().Connected)
            {
                TestXamlPage tp = new TestXamlPage();
                Navigation.PushAsync(tp);
                return false;
            }
            if (DependencyService.Get<INetScan>().ScanFinished)
            {
                DependencyService.Get<INetScan>().StartScan();
            }
            return true;
        });
    }

Before I added the return false to the above code this worked fine on Android as sool as I tried it on iOS the timer did not stop so I added the return false.
It still doesnt stop in iOS.
The code appears to step over the return false when debugging (I am using VS2013 with a mac build) but it keeps going and the second page just keeps initialising.

Any ideas ?

I have seen a few posts regarding the StartTimer but nothing like this.

Wayne


Viewing all articles
Browse latest Browse all 58056

Trending Articles