Forum Cross Platform with Xamarin

How can I make a contentpage in Xamarin disappear after seconds by using StartTimer() ?

ndhuy15396ndhuy15396 Member

Just like the above title, I don't know how to use StartTimer() for contentpage in order to make it disappear. Can somebody give me some suggestions or guidances

Best Answer

  • VIVEKNEGIVIVEKNEGI US ✭✭✭
    Accepted Answer

    private void ScheduleWebRequest()
    {
    // Start a timer that runs after 1 minute.
    Device.StartTimer(TimeSpan.FromMinutes(1), () =>
    {
    Task.Factory.StartNew(async () =>
    {
    //Here do you code to disapper
    });

            return false;
        });
    

    }

Answers

  • VIVEKNEGIVIVEKNEGI USMember ✭✭✭
    Accepted Answer

    private void ScheduleWebRequest()
    {
    // Start a timer that runs after 1 minute.
    Device.StartTimer(TimeSpan.FromMinutes(1), () =>
    {
    Task.Factory.StartNew(async () =>
    {
    //Here do you code to disapper
    });

            return false;
        });
    

    }

Sign In or Register to comment.