-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Alerts currently don't work if you call them from the constructor #1514
Comments
In Forms calling alerts from the constructor would put them in a queue that would be processed after Appearing; maybe the queue stuff didn't get ported? |
There's a dup here suggesting maybe we shouldn't support it: #4336 |
IMHO this should not be a supported scenario that could be documented. The UI isn't visible yet, you basically shouldn't do anything in your constructor. |
I'm guessing people do it because it's the logical equivalent of |
Another use case here is that the ctor is the easiest place for an alert you only want to show on the first load of a page. In theory you could check for this case in "Appearing" but it's a bit more code and since the ctor works then why not just put it there. |
We could introduce a "FirstLoad" type of thing like blazor... so you ahve OnAPpearing that happens eveyr time, but OnFirstLoad or something that is after the screen loads for teh first time? |
Not reproducible with Android 11. |
Re-opening because I'm not sure if this is the right behavior on all platforms, even if perhaps it works on Android. |
The dup bug specifically mentioned that it doesn't work on Windows: #4336 |
Testing with RC3 and main branch, this is now working: Reviewing the history have been fixed by the commit fffaae1. |
Description
If you call DisplayAlert from the constructor of a page it currently does not work on WinUI
Go to the alerts page and add a call to DisplayAlert from the ctor
The text was updated successfully, but these errors were encountered: