Navigation is not done when showing Alert in the Init() method
See original GitHub issueHello.
When I try to show an alert from the PageModel’s Init() method (if there is any exception I want to show any UI alert), not only the navigation to the page is not done, but the navigation is “broken” for the all the application (so I can’t do push to anywhere).
public override void Init(object initData)
{
base.Init(initData);
...
UserDialogs.Instance.Alert("Message", "Message content", "Close");
}
I have already tried without the UserDialogs plugin, and the error persists:
((MasterPage)Application.Current.MainPage).DisplayAlert("Message", "Message content", "Close");
Is this a bug? Any workaround?
Waiting for your replies. Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Angular, Show Success alert after rooter navigate
4 Answers. You need to add the alert popup event in the ngOnInit method of the component which is linked to the route...
Read more >Using router.navigate to navigate to another component ...
Hi I am implementing a project in angular . and i am using the version ng-version="4.3.0" Here i am redirecting the app to...
Read more >React Native Navigation: Tutorial with examples
In this tutorial, we'll go through the basics of React Native navigation, show you how to get started using React Navigation in a...
Read more >Navigate with named routes
The solution is to define a named route, and use the named route for navigation. To work with named routes, use the Navigator.pushNamed()...
Read more >UIAlertView | Apple Developer Documentation
Use the show() method to display an alert view after it's configured. ... The view hierarchy for this class is private and must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m had similar issues with Init().
Since this get’s called before the view model is set as the BindingContext on the page, then you can’t perform any UI activities here.
I’ve had to resort to saving the parameter as a member variable, then doing any of my real work in the ViewIsAppearing()
Task.Factory.StartNew(() => DownloadDataFromInternet(), TaskCreationOptions.LongRunning);