Skip to content
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

Added a draft for in-app notifications #100

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gentledepp
Copy link

I followed the "ContentDialog" approach and tried my best.

Please let me know if this may ever make it into avalonia.
And what needs to be done (polishing, etc) to get it in.

Here is the gist:

b538fa72-5ec6-40c9-b9f2-d27d71735ff2

@thevortexcloud
Copy link

thevortexcloud commented Dec 19, 2024

Avalonia already has a notification API. What does this do differently?

https://reference.avaloniaui.net/api/Avalonia.Controls.Notifications/Notification/

@gentledepp
Copy link
Author

Hey @thevortexcloud as mentioned here #99

  1. I did not know about those notifications
  2. And I do not like that you have to register some host control in a window.

This feels hacky to me.
Since I stumbled across ContentDialog and its implementation, I created this notification system in a similar fashion.
Thereby, it is made sure that the NotificationHost is also added to the OverlayLayer but is always below the ContentDialog.

My reason for this is: The ContentDialog is a modal dialog. So even if there was a notification during a dialog bein open, it should be hidden by it.
Am I wrong?

So I am sure you will not take this PR - no harm done.
However, It would be nice to have this "auto setup of the notificationhost" as it is done with the ContentDialog

@thevortexcloud
Copy link

And I do not like that you have to register some host control in a window.

Unless something has changed since I last used it (or I am misremembering), you don't? You just call the API on a specific window and it works.

Anyway, it sounds like what you want is fairly similar to what this packages does?

https://github.com/AvaloniaUtils/DialogHost.Avalonia

So I am sure you will not take this PR - no harm done.

It's not actually up to me. I am not in charge around here. I am not against this, but I feel like it would be better to improve the existing notification system rather than try to maintain two of them. From memory there was already vague plans to do that since most platforms have a native notification/toast API which Avalonia could support. No idea if anybody made any progress on it though.

@gentledepp
Copy link
Author

yes absolutely - improving the existing system makes much more sense!
I just did not know it existed in the first place 😅 I just overlooked it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants