-
Notifications
You must be signed in to change notification settings - Fork 337
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
Add Platform-Specific Option to Enable Snackbar on Windows #1780
Add Platform-Specific Option to Enable Snackbar on Windows #1780
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work @brminnick I think we should either use the value
parameter or remove it though.
Co-authored-by: Shaun Lawrence <shaunrlawrence@gmail.com>
Thanks Shaun! Good catch. Updated ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Shaun + Vlad! I think I'm happy with the implementation now.
We've added enough fail-safes to the code to assist future devs who haven't yet seen the platform-specific implementation docs for Snackbar
on Windows. Hopefully throwing these exceptions at runtime will help folks find the docs instead of opening a new Issue on the repo.
And if they do open an issue for one of these InvalidOperationExceptions, we can just copy/paste the link from the stack trace, point them to the docs and close the issue.
Snackbar now requires additional code to be added on Windows to the Package.appxmanifest file: MicrosoftDocs/CommunityToolkit#374
Currently, without adding this additional code to
Package.appxmanifest
,CommunityToolkit.Maui
causes all Windows apps to crash on launch.This PR adds
Options.ShouldEnableSnackbarOnWidows
to allow users to opt-in to enabling Snackbar on Windows, ensuring that they have added the additional required code toPackage.appxmanifest
.