-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 Close and ClearAll api for INotificationManager and IManagedNotificationManager #15628
Add Close and ClearAll api for INotificationManager and IManagedNotificationManager #15628
Conversation
You can test this PR using the following package version. |
|
@cla-avalonia agree |
@@ -13,6 +14,18 @@ public interface INotificationManager | |||
/// Show a notification. | |||
/// </summary> | |||
/// <param name="notification">The notification to be displayed.</param> | |||
void Show(INotification notification); | |||
/// <param name="cancellationToken">The cancellation token.</param> | |||
void Show(INotification notification, CancellationToken? cancellationToken = null); |
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.
Why CancellationToken? cancellationToken = null
CancellationToken cancellationToken = default
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.
It will likely go into 11.1.1 |
Can x.x.1 have such breaking api changes? |
@wieslawsoltes in current state of this PR, new interface members are added on NonClientImplementable interface. No user should be able to implement this interface either way. CancellationToken parameter could break some existing apps, but it was reverted, so it's fine. |
You can test this PR using the following package version. |
instead of resetting you can add an show overload. The CancellationToken parameter is very useful. |
What does the pull request do?
What is the current behavior?
There is no easy way to close notification from code.
What is the updated/expected behavior with this PR?
There is easy way to close notification from code.
How was the solution implemented (if it's not obvious)?
Adds Close() and ClearAll() methods to INotificationManager/IManagedNotificationManager
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues