Reputation: 403
I am using This WPF NotifyIcon and all works fine:
<tb:TaskbarIcon
Name="taskbarIcon"
IconSource="icon.ico"
ToolTipText="hello world">
</tb:TaskbarIcon>
But when minimize my application i can see the application open and not only the Icon
in the Task Bar
.
How to hide the application when minimize ?
Upvotes: 1
Views: 865
Reputation: 1449
Subscribe to the StateChangingEvent
Add this code in your Window's Constructor
StateChanged += (s, e) => if (WindowState == WindowState.Minimized) Hide();
Upvotes: 1