NotifyIcon not working in demo application

1 Answer 78 Views
NotifyIcon
Deltaohm
Top achievements
Rank 2
Iron
Iron
Deltaohm asked on 15 Nov 2021, 07:53 AM

Hello,
I'm using a notifyIcon in my application and it doesn't work, but I saw that also the samples included in  "Progress Telerik UI for WPF"  don't work.
Maybe there is a windows 10 setting? I look in the settings of tray notification area but I didn't see any setting that can disable the working.

Thank you

Luigi

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 17 Nov 2021, 04:18 PM

Hello Luigi,

Can you please clarify what you mean by saying that the RadNotifyIcon is "not working" - is the icon not displayed in the taskbar or is the interaction with it limited (popup or tooltip is not displayed)? Please also clarify which version of Telerik UI for WPF and .NET you're using along with any specifications you find relevant.

Generally speaking, the control exposes a GetUserNotificationState method which can be used to control whether or not notifications are displayed depending on the user's state. This method, however, is not called in the demos from our samples application.

Nonetheless, the icon should be displayed as expected regardless of this method. To answer your question - I cannot think of any windows setting which may affect the icon in such a manner. If the icon is not displayed at all, you can check whether you're setting a different Guid when running the application in Debug and Release mode. Here's an example:

    public static class GuidHelper
    {
        public static Guid GetGuid()
        {
#if DEBUG
            var guid = "7337538c-ed75-48b8-9f83-1e8b60d8db69";
#else
            var guid = "e8ec639f-2aa2-4709-8526-d72fecc63b6c";
#endif
            return new Guid(guid);
        }
    }

If none of this helps, please send over a small sample project where the icon does not work for you and specify in what aspect the functionality is not as desired. I would then be more than happy to investigate further and try to suggest a viable solution.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Deltaohm
Top achievements
Rank 2
Iron
Iron
commented on 18 Nov 2021, 03:14 PM | edited

Hi Dylan,

I use Telerik for Wpf R3 2021 SP1,  the icon is not displayed in taskbar, I'm using demo sample "Notify Icon | First look", I click on buton "Show NotifyIcon" and nothing happens. If your test works, means that the problem is inside my system.

P.S: In my application I still use version 2021.1.325.310 because of question https://www.telerik.com/forums/upgrade-from-2021-1-325-310-to-2021-3-914-45, so is not a version problem.

Dilyan Traykov
Telerik team
commented on 19 Nov 2021, 12:26 PM

Hello Luigi,
I'm attaching a short recording of the result I observe by running the First Look demo at my end. As you can see, the icon is shown and can be interacted with as expected.
Can you please demonstrate how this differs from the result at your end?
Deltaohm
Top achievements
Rank 2
Iron
Iron
commented on 23 Nov 2021, 08:19 AM

Sorry Dylan, I believe that your example works, but my one not.
I attached my own gif.

I hope can be useful

Thank you

Luigi

Dilyan Traykov
Telerik team
commented on 24 Nov 2021, 12:56 PM

Hello Luigi,
Thank you very much for the provided recording.
What I can suggest at this point is to try the suggestions from this article: How to Fix System Tray or Icons Missing in Windows 10.
Can you please try going over all of them and let me know if any particular one resolves the issue for you?
I will be awaiting your reply.

Deltaohm
Top achievements
Rank 2
Iron
Iron
commented on 25 Nov 2021, 12:01 PM

None of that procedure had success.

I just tried with Progress Telerik UI for WPF R1 2021 SP1 and it works!

I attacched gif with test with R1 and R2 at same time.
Thank you
Luigi

Dilyan Traykov
Telerik team
commented on 26 Nov 2021, 04:02 PM

Hello Luigi,
Thank you for the provided recording.
This is indeed rather peculiar.
My only remaining suspicion is that there is some conflict between the two installations of the Telerik UI for WPF suite. Would you find it possible to uninstall both versions along with any sample applications (such as the demo application from the recordings) and try to reinstall the latest version afterwards?
Please let me know how this goes.

Deltaohm
Top achievements
Rank 2
Iron
Iron
commented on 11 Feb 2022, 09:33 AM

Hi,
I come back to this open question, because now demo project (R1 2022) works on my windows 11, but my notify (R3 2021) still doesn't.
I studied your demo and I replied it in a my very simple project (attached). I think that problem can be related to TrayIconSource.
As you can see the icon can be resolved by Image, but not in Radnotify (I removed it from xaml in order to start application). I observed the same behaviour in my full project: the same image is resolved eveywhere but not for TrayIconSource.
Again, if I remove the TrayIconSource setting, ShowBalloonTip doesn't work of course.
Thank you
Luigi
Stenly
Telerik team
commented on 16 Feb 2022, 09:18 AM

Hello Luigi,

I will review the sample project and get back to you with more information regarding this matter later today.

Stenly
Telerik team
commented on 16 Feb 2022, 04:10 PM

Hello Luigi,

May I ask if you could provide a bit more information regarding your latest comment? More specifically, what do you mean by the "the icon can be resolved by Image, but not in RadNotify"? After running the provided sample project, and clicking on the button, the application results in an exception.

Deltaohm
Top achievements
Rank 2
Iron
Iron
commented on 16 Feb 2022, 04:38 PM

Yes, the exception is "System.ArgumentException: 'Could not resolve image source pack://application:,,,/ShowNotifyIcon;component/".
But as you can see the same component is used for Image control and the exception is not raised there.

This is the problem, setting NotifyIcon.TrayIconSource I get an exception (and you get too, if I understood), but the image is in the correct position because it is loaded correctly for a different contro in same window, and it is used as in demo project where it works (but in different version...).
Luigi

Stenly
Telerik team
commented on 21 Feb 2022, 03:38 PM

Hello Luigi,

Upon further investigating the provided sample project, the exception is thrown if a UriKind value is not specified, as well as if the provided sample icon's Build Action is not set to Resource. I have modified the sample project, so, could you give it a try?

Deltaohm
Top achievements
Rank 2
Iron
Iron
commented on 23 Feb 2022, 02:28 PM | edited

I tried,

Your sample works, also without urikind, but the icon should be resource.

Thank you

Luigi

Stenly
Telerik team
commented on 24 Feb 2022, 10:15 AM

Hello Luigi,

I am happy to hear that this matter is now resolved. Let me know if you need any further assistance regarding this topic.

Tags
NotifyIcon
Asked by
Deltaohm
Top achievements
Rank 2
Iron
Iron
Answers by
Dilyan Traykov
Telerik team
Share this question
or