Good question Shreyas. Unfortunately, I don't see anything on the NotifyIcon API that would allow this functionality. I could definitely see that being useful. Perhaps that would require some kind of custom popup that didn't use the NotifyIcon. Sounds like a fun challenge!
@@SingletonSean Yeah sadly Notify Icon doesn't have that functionality and more over its from System.Windows.Forms. It would have been great if they had provided a Wpf version of that with the features to add buttons.
Thanks a lot, Sean May I ask a question related to the context menu? Is it possible to call our application from window explorer? For example, an application working with CSV file. If the user right-clicks this type of file on Window Explorer then the context menu pops up with the application icon. And after a click on this icon then the application will be opened with the CSV file load into it. It working just like WinZip software. Could you please give me some idea? Thanks in advance.
I think I see what you mean, I've actually never implemented anything like this but could see it being extremely useful. I remember a while back I was trying to find a way to remove a specific application from the Windows Explorer context menu. I remember having to mess around with some registry keys, so perhaps that would be where the app would have to get registered in order to appear in the context menu. I just did a bit of research, but didn't find anything clear so I assume there's no easy WPF solution. I think I'm going to look more into this. Good suggestion Sirisak!
Thank you for your answer. I found one library in Github that may suit the requirement as below. but not sure whether it works with WPF or not. github.com/dwmkerr/sharpshell
Hi, nice tutorial ! thank you... i have a simple question... sometimes notification icons are hidden and you got to click the little arrow to make them pop... how can we make our notification icon be the very first one the way it's always showing ? i know the user can drag it manually but it's a no way... i'm making a little app that indicate a "a" or "A" depending on the fact caplocks key is on or off for a friend who's laptop doesn't have the led on it... i know it has already be done but it was a perfect exercice for notification icons :p It works well but if the notification icon is not always showing it has no sense... i'm not using info baloon...because sometimes there is a lag effect and for this purpose i don't want to use them. if any idea feel free :)
It's just regular Intellisense (CTRL + Period), although honestly, it's kinda slow and I'd rather go through NuGet and the References popup to add packages.
You guessed it A B! I'm continuing this concept in a video releasing this week for a countdown timer notification application where I setup a notification service. It's supposed to be kind of a New Year's special with the whole countdown concept, haha.
Thanks S Afzal! I'm not entirely sure yet. I think there's some weird stuff in WinUI that might be able to help us. The documentation on WinUI + WPF + XAML Islands is lacking, and unfortunately I haven't had time to dig into all of that myself. Using this will also restrict your app to Windows 10, which might be okay. This looks interesting though! Let me know if this helps: docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-4#add-a-notification
@@SingletonSean Thank you for the useful reference. In my view the technique used in this tutorial is the simplest. I am surely going to use it in my applications. Thank you for leading the path .
Hi Sean! Thanks for your tutorial. Nevertheless, it always takes forever when I try to automatically add a reference (I don't even think it works on my PC). I used your source code from GitHub. Apparently, you use .Net Core 3.1 for the project but it seems that you are using a library from .Net Framework 4.72. So, I had to browse the library myself... Do you have any comment on it? Also, if I'm not mistaken COM libraries are only used for and by Microsoft stuffs but .Net Core is cross-platform.
Thanks Ludovic! I had the same thinking that the COM libraries didn't work with .NET Core since it's cross-platform and the COM libraries are Window specific. As for automatically adding references taking forever, I have the same issue sometimes, so we must have similar VS versions, haha.
@@SingletonSean I definitely have the latest VS version... By the way, you reckoned in one of your previous tutorials that you hadn't updated for a while ^^ . I honestly don't know much about COM stuffs (I don't really have a developer background) but I recently began a WPF / ASP.Net project where I import Excel stuffs to SQL databases. I just ended up using .Net Framework 4.8 for both of them.
Great explanation, thanks too much Sean for all your videos!! Respect!! hhh Just a remark, the NotifyIcon doesn't work well with ClickOnce deployment when I click on the 'appref-ms' shortcut generated, but nicely works when clicked on .exe file ^^'
Thanks Aymane! I had some issues with "dotnet publish" deployment too. Glad you were able to find an alternative! It would be so much easier if there were a WPF NotifyIcon so that we wouldn't have to reference Windows Forms 😅
Quick and clear tutorial about an underused functionality, thank you Sean !
PROPS, Sean, your Tutorial was a wonderful primer on how to use the Notify icon - much appreciated!
Excellent!!!
Man you are a attractive genius for sure namely for WPF!
short, useful and clear, thank you!
Awesome tutorial, very clear and straightforward, thank you very much!
Thanks for the feedback Yoni!
Thank you for such a clear tutorial!!!
I cant seem to add the forms refs to my .net 5 project
Watching you misspell resources felt like being walter white shouting at hank through the car window
is this posible with MAUI applications?
Thanks for help :)
very nice, and helpful
There is no notify icon in .net5 wpf
How create a notify app in .net5 wpf
Only 7.0 or superior...
@@miciliniroll how to in. Net 7, because I don't see it in. Net 7 + also
Great video, thanks. Can you also make a video about how to make applications running in the background?
Great stuff.
Can you do that in MAUI app?
Hi Sean. This was great. Is there any way to add a button to the toast notification like in the alarm popups which we get "Dismiss" and "Snooze".
Good question Shreyas. Unfortunately, I don't see anything on the NotifyIcon API that would allow this functionality. I could definitely see that being useful. Perhaps that would require some kind of custom popup that didn't use the NotifyIcon. Sounds like a fun challenge!
@@SingletonSean Yeah sadly Notify Icon doesn't have that functionality and more over its from System.Windows.Forms. It would have been great if they had provided a Wpf version of that with the features to add buttons.
Thanks a lot, Sean
May I ask a question related to the context menu?
Is it possible to call our application from window explorer?
For example, an application working with CSV file. If the user right-clicks this type of file on Window Explorer then the context menu pops up with the application icon.
And after a click on this icon then the application will be opened with the CSV file load into it.
It working just like WinZip software.
Could you please give me some idea?
Thanks in advance.
I think I see what you mean, I've actually never implemented anything like this but could see it being extremely useful. I remember a while back I was trying to find a way to remove a specific application from the Windows Explorer context menu. I remember having to mess around with some registry keys, so perhaps that would be where the app would have to get registered in order to appear in the context menu. I just did a bit of research, but didn't find anything clear so I assume there's no easy WPF solution. I think I'm going to look more into this. Good suggestion Sirisak!
Thank you for your answer.
I found one library in Github that may suit the requirement as below. but not sure whether it works with WPF or not.
github.com/dwmkerr/sharpshell
Hi, nice tutorial ! thank you... i have a simple question... sometimes notification icons are hidden and you got to click the little arrow to make them pop... how can we make our notification icon be the very first one the way it's always showing ?
i know the user can drag it manually but it's a no way...
i'm making a little app that indicate a "a" or "A" depending on the fact caplocks key is on or off for a friend who's laptop doesn't have the led on it...
i know it has already be done but it was a perfect exercice for notification icons :p
It works well but if the notification icon is not always showing it has no sense... i'm not using info baloon...because sometimes there is a lag effect and for this purpose i don't want to use them.
if any idea feel free :)
What about other colours?
How did you get that clue that says add reference or install package? here is the content: 2:00
It's just regular Intellisense (CTRL + Period), although honestly, it's kinda slow and I'd rather go through NuGet and the References popup to add packages.
@@SingletonSean thank for your replay, I have found bunch of good content about WPF tutorials on your channel.
Thanks, realy helpfull tutorial. If you will make more practic tutorial with notification service, smth like messangers it will be awesome.
You guessed it A B! I'm continuing this concept in a video releasing this week for a countdown timer notification application where I setup a notification service. It's supposed to be kind of a New Year's special with the whole countdown concept, haha.
Thank you for such a nice tutorial. Is there any way to do it without referencing System.Windows.Forms like pure WPF way?
Thanks S Afzal! I'm not entirely sure yet. I think there's some weird stuff in WinUI that might be able to help us. The documentation on WinUI + WPF + XAML Islands is lacking, and unfortunately I haven't had time to dig into all of that myself. Using this will also restrict your app to Windows 10, which might be okay.
This looks interesting though! Let me know if this helps: docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-4#add-a-notification
@@SingletonSean Thank you for the useful reference. In my view the technique used in this tutorial is the simplest. I am surely going to use it in my applications. Thank you for leading the path .
Hi Sean! Thanks for your tutorial.
Nevertheless, it always takes forever when I try to automatically add a reference (I don't even think it works on my PC). I used your source code from GitHub. Apparently, you use .Net Core 3.1 for the project but it seems that you are using a library from .Net Framework 4.72. So, I had to browse the library myself... Do you have any comment on it?
Also, if I'm not mistaken COM libraries are only used for and by Microsoft stuffs but .Net Core is cross-platform.
Thanks Ludovic! I had the same thinking that the COM libraries didn't work with .NET Core since it's cross-platform and the COM libraries are Window specific. As for automatically adding references taking forever, I have the same issue sometimes, so we must have similar VS versions, haha.
@@SingletonSean I definitely have the latest VS version... By the way, you reckoned in one of your previous tutorials that you hadn't updated for a while ^^ . I honestly don't know much about COM stuffs (I don't really have a developer background) but I recently began a WPF / ASP.Net project where I import Excel stuffs to SQL databases. I just ended up using .Net Framework 4.8 for both of them.
Thank 😁
Thanx!
niiiiice thank you
Great explanation, thanks too much Sean for all your videos!! Respect!! hhh
Just a remark, the NotifyIcon doesn't work well with ClickOnce deployment when I click on the 'appref-ms' shortcut generated, but nicely works when clicked on .exe file ^^'
Thanks Aymane! I had some issues with "dotnet publish" deployment too. Glad you were able to find an alternative! It would be so much easier if there were a WPF NotifyIcon so that we wouldn't have to reference Windows Forms 😅
Wow
System.Drawing.Common is not supported on this platform.
Fixed it. Mismatch between .Net framework and System.Drawing.Common version.