Skip to content

Setting NotifyIcon.TooltipText at runtime doesn't work #670

@soleon

Description

@soleon

Describe the bug

The tooltip text of the notify icon stays unchanged regardless how it is changed at runtime.

The source code doesn't seem to do anything when setting the TooltipText property. The OnTooltipTextChanged handler simply passes the string value to the managed property that's all, nothing is done to the private _notifyIconService.

To Reproduce

Consider the following code snippet:

XAML

<ui:FluentWindow x:Class="Wpf.Ui.Demo.Simple.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
   <ui:TitleBar>
       <ui:TitleBar.Tray>
           <ui:NotifyIcon Name="NotifyIcon" TooltipText="Default" />
       </ui:TitleBar.Tray>
   </ui:TitleBar>
</ui:FluentWindow>

Code Behind

new Timer(_ => NotifyIcon.TooltipText = DateTime.Now.Second.ToString(), null, 1000, 1000);

Expected behavior

The tooltip text of the tray icon should change when it is updated at runtime.

Screenshots

No response

OS version

Windows 11 Version 10.0.25393 Build 25393

.NET version

.NET 7.0.304

WPF-UI NuGet version

3.0.0-preview.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions