maxkoshevoi / NureTimetable

Xamarin Forms application for viewing timetable of groups, teachers and rooms of the Kharkiv National University of Radio Electronics
https://play.google.com/store/apps/details?id=com.whitebox.nuretimetable
41 stars 5 forks source link

PageAppearing method is not triggering in ManageLessonsViewModel #35

Closed maxkoshevoi closed 3 years ago

maxkoshevoi commented 4 years ago

When ManageLessonsPage first loads, PageAppearing event is not firing.

Steps to reproduce:

Expected results: Message appears, that you should update timetable first.

Actual results No message appears

maxkoshevoi commented 4 years ago

There is some strange bug where in some circumstances if any Navigation method is awaited, PageAppearing event won't be triggered.

So both:

// This
await Navigation.PushAsync(new ManageLessonsPage());
// And this
await Device.InvokeOnMainThreadAsync(async () =>
{
    await Navigation.PushAsync(new ManageLessonsPage());
});

Results in Appearing event not triggering on ManageLessonsPage.

And:

// This
Navigation.PushAsync(new ManageLessonsPage());
// This
Device.InvokeOnMainThreadAsync(async () =>
{
    await Navigation.PushAsync(new ManageLessonsPage());
});
// And this
Device.BeginInvokeOnMainThread(async () =>
{
    await Navigation.PushAsync(new ManageLessonsPage());
});

Results in Appearing event triggering on ManageLessonsPage.

image

So far I encountered this bug in two places: Navigation.PushAsync(new ManageLessonsPage()... and Navigation.PopToRootAsync();

maxkoshevoi commented 3 years ago

Ok, fine. I won't await my commands