My aim is to place my application in the tray bar but I don't know how to do that for a WPF application ! (for a winform there is lots of docs but I don't find anything for Wpf)
Thanks
My aim is to place my application in the tray bar but I don't know how to do that for a WPF application ! (for a winform there is lots of docs but I don't find anything for Wpf)
Thanks
You could use this library for the tray icon, and to not have any windows you should remove any StartupUri
that may be defined in the App class by default. Then you can override OnStartup
to prepare any logic that your application should perform.
Not sure if you can assign a TaskbarIcon
of this library directly to the application since it is normally used on Windows. But you can create a dummy popup to make it show up.
public TaskbarIcon MyTaskbarIcon { get; set; }
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
Popup pu = new Popup();
pu.Child = MyTaskbarIcon;
//...
}
If you can have windows you can create a TaskbarIcon there and then you can call Hide()
if you need it to completely disappear.
After testing it, I recommand http://possemeeg.wordpress.com/2007/09/06/minimize-to-tray-icon-in-wpf/
But be sure your icon is an an “Embedded Ressource” not “Ressource” in properties in Visual Studio.