Open ssolmer opened 4 years ago
Edit! This doesn't work.
Having determined that this has to do with setting the tooltip before the taskbar icon has loaded properly (there are a lot of assumptions underlying this), I think I've solved this in my application. Instead of setting ToolTipText
in XAML, I set it in the Loaded
event of the associated window:
private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
this.TrayIcon.ToolTipText = "Your tooltip";
}
And then of course you need to do something like:
<Window ...
Loaded="Window_Loaded">
Note that project Monitorian seems to have the same problem despite not using wpf-notifyicon and having their own wrapper around a WinForms icon instead (see their notify icon code here).
Thank you @samhocevar. It seems that posting my fix was premature, as the "same" error re-appeared in our crash logs a few hours afterwards. So my solution above does not work either.
I am getting this same error - but only occasionally.. Seems like a race condition somewhere
NotifyIcon.Wpf.TaskbarNotification (.NET 4.0) v1.0.5.0
I get this exception when attempting to show a dialog window. There are other people on StackOverflow who have encountered this error as well. https://stackoverflow.com/q/28833702/2596334