Underground Cavern by laspinter

Xamarin Tips: Access Progress Bar from the first page to the second page?

Tuğçe
May 12, 2021

We can use MessagingCenter for this. In your first page, subscribe a message:

public FirstPage()
{
MessagingCenter.Subscribe<SecondPage>(this, "StartProgress", (sender) =>
{
StartProgress();
});
}

public void StartProgress()
{
//do progression here
//and set Progress bar
}

In second page send the message:

private void Onpress(s, e)
{
MessagingCenter.Send(this, "StartProgress");
Navigation.PopToRootAsync();
}

You can find documentation in here.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response