Click here to Skip to main content
15,868,070 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I'm started wpf project in which I generate notifyIcon baloon tooltips. It works buth there is only one message stored at notification centre. The next tooltip displayed but not stored on the notification panel. How can I make more than one?

What I have tried:

private static readonly DependencyProperty NotifyRequestProperty =
    DependencyProperty.Register(
        "NotifyRequest",                            // propertyName (определяется в XAML)
        typeof(NotifyRequestRecord),                // propertyType
        typeof(NotifyIconWrapper),                  // ownerType (имя класса)
        new PropertyMetadata(                       // (PropertyChangedCallback propertyChangedCallback)
            (depObject, eventArg) =>
            {
    NotifyRequestRecord record = (NotifyRequestRecord)eventArg.NewValue;
    ShowModifiedBallonTip(depObject, record);
}));

private static void ShowModifiedBallonTip(DependencyObject depObject, NotifyRequestRecord record)
{
    ((NotifyIconWrapper)depObject)._notifyIcon?.ShowBalloonTip(record.Duration, record.Title, record.Text, record.Icon);
}

public class NotifyRequestRecord
{
    public string Title { get; set; } = "";
    public string Text { get; set; } = "";
    public int Duration { get; set; } = 1000;
    public ToolTipIcon Icon { get; set; } = ToolTipIcon.Info;
}
Posted
Updated 29-Jul-21 0:05am
v2

Maintain a list of notifications, and any time that list contains 1 or more items, display the balloon. If there are more than one notification, provide a way for the user to move from one to the next (and back again).
 
Share this answer
 
Comments
max max 2021 26-Jul-21 5:18am    
thanks for reply but the question is - why the new generated baloontooltip doesn't stored at windows 10 notification centre as new message, but replaces the old one. I'd like to have new for every new generated (like standart mail program generates). But I have only new popup message but no new at notification centre
#realJSOP 27-Jul-21 5:23am    
I have no idea what you just said.
Sounds like you're trying to display Windows 10 notifications in the action centre. The balloon tip doesn't play well with that; you have to use a different library to show notifications:

Send a local toast notification from C# apps - Windows apps | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900