-
Notifications
You must be signed in to change notification settings - Fork 189
Add TrayIcon sample app #89
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
Conversation
|
Hey @logiclrd, I really have to apologize for not responding earlier. I wanted to wait for AvaloniaUI/Avalonia#7880 to be fixed but this seems to be more complicated than thought. Moreover your sample gave me some NRE that I didn't understand until today. And tbh, I forgot about this PR for quite a while. Today I figured out that binding either directly to void or using |
…tray icon (on supported platforms): - Updated AboutWindow.axaml to include a Label indicating how it was activated. Added method SetActivationMode to AboutWindow.axaml. Added enumerated type ActivationMode.cs. - Updated the ShowAboutWindow command handler method in App.axaml.cs to call AboutWindow.SetActivationMode. - Added command ClickedCommand with handler method Clicked to App.axaml.cs. - Updated App.axaml to wire up TrayIcon.Command to ClickedCommand.
…md to include it.
|
Awesome 🙂 I've merged the latest in from the mainline, updated the changes here to follow changes to the
There was also a mistake in the directory name in the link from I have verified that the changes to the |
|
Should I bump the references to Avalonia NuGet packages to a newer version? I'm sort of conflicted about this, because on the one hand, most of them are at the latest release version, but it's not 100% consistent and the version numbers that are there now happen to be the first version in which the sample runs properly. But the majority of the samples are using 11.3.8, so the ones that aren't are probably just outliers that should be using 11.3.8. I'll bump the references. 🙂 |
…ape key (IsCancel="True").
…he latest release.
8e97e0f to
b57a56e
Compare
|
Let me know if any other changes are needed. 🙂 |
… check for a notification area icon.
timunie
left a comment
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.
Only these two comments to fix, otherwise it looks good to merge.
src/Avalonia.Samples/DesktopIntegration/TrayIcon/TrayIcon.csproj
Outdated
Show resolved
Hide resolved
… directly instead of ReactiveCommand. Replaced the NuGet reference to Avalonia.ReactiveUI with one to CommunityToolkit.Mvvm. Updated ExitApplication in App.axaml.cs to use TryShutdown instead of Shutdown where possible, and to support IControlledApplicationLifetime if the current lifetime isn't an IClassicDesktopStyleApplicationLifetime. Made the names of the commands in App.axaml/.axaml.cs more descriptive.
|
LGTM. THX 🙏 |
|
Okay I screwed up now, so don't worry your changes have been merged just from the wrong branch 🙈 |
What does the pull request do?
Adds a sample application demonstrating the use of
<TrayIcon>inApp.axaml, including an associated menu.TrayIcon.csproj optimistically references as-yet-nonexistent version 11.2.0 of Avalonia, in the hopes that it will include the bug fix for crashing when activating tray icon menu items.
UPDATE: 11.2.0 did indeed fix the problem, but this PR went to sleep for a while and now 11.3.8 is out.
Scope of this PR:
Checklist
If this is a new Sample
In any case