the49ltd / The49.Maui.BottomSheet

.NET MAUI library used to display pages as Bottom Sheets
MIT License
313 stars 30 forks source link

View Model Dismiss Async #104

Open Kremed opened 6 months ago

Kremed commented 6 months ago

is there any way to Dismiss BottomSheet from Command on ViewModel !!? I have tried this, but this calls the content page that has been opened before the bottom sheet:

 else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
 {
     //BottomSheet page = new BottomSheet();
     //await page.DismissAsync();
     await Application.Current.MainPage.Navigation.PopModalAsync(true);
     await Application.Current.MainPage.Navigation.PushModalAsync(new LoginViewPage(new LoginViewViewModel()), true);
 }
softlion commented 5 months ago

image

tolgraven commented 4 months ago

You can either skip the animation and your PushModal should work, or insert an await Task.Delay(500) to wait it out.