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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With