user3531148
user3531148

Reputation:

Creating a collapsed tray bar in with hardcodet wpf notify icon extension

In my application I use the wpf notify icon extension from hardcodet.net.

With this extension I create periodically a custom balloon notification. For this I need a task bar icon object. But in my situation I can not use the main task bar icon of the application. I must use a task bar icon stored in a collapsed window. So that the balloon icon will shown above the task bar and not under it.

Now to my question. In the code above you can see that the visibility attribute of the taskbar icon is set to collapsed.

<Window x:Class="center_approver_client_traybar_service.HiddenWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tb="http://www.hardcodet.net/taskbar"
        Title="HiddenWindow" Height="300" Width="300" Visibility="Collapsed">
    <Grid>
        <tb:TaskbarIcon x:Name="HiddenWindowTrayIcon" Visibility="Collapsed" />
    </Grid>
</Window>

But when I use the task bar icon in my application to show the custom balloon notification. There is an empty task bar icon shown and not nothing.

Can someone help me please?

Upvotes: 2

Views: 974

Answers (1)

Mario M Greer
Mario M Greer

Reputation: 31

You must set the icon for your TaskbarIcon control for example:

<tb:TaskbarIcon x:Key="TrayIcon" IconSource="yurIcon.ico" ToolTipText="your tooltip">

Upvotes: 1

Related Questions