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

PushAsync from another thread does execute

$
0
0

using System;
using System.Collections.Generic;
using Xamarin.Forms;

namespace LeadYouToMe
{
public partial class SplashPage : ContentPage
{
System.Threading.Timer _SplashTimer = null;

    public SplashPage ()
    {
        InitializeComponent ();

        _SplashTimer = new System.Threading.Timer ( SplashTimerCallback, null, 5000, 10000);
    }

    protected void SplashTimerCallback( object state )
    {
        if (_SplashTimer != null)
        {
            _SplashTimer.Dispose ();
            _SplashTimer = null;
        }

        // navigate to the normal start page..
        this.Navigation.PushAsync (new StartPage());
    }
}

}

I'm just trying to do a short timed splash screen, I know how to do it in normal android apps, but not in Xamarin Forms. There is no "runonuithread" or "invokeonuithread" as on Ios or android.

The page gets created, I can set break points in the constructor, but never gets displayed. I can verify the page works by skipping my splash page, and just using StartPage as my initial page.

Any suggestions would be appreciated.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>