UWP how to blink in Taskbar?

Ankur Tripathi 1 Reputation point
2019-12-03T06:27:08.63+00:00

UWP how to blink in Taskbar

I am using C# / UWP to make an application. In that application, I want to blink the window if a particular event occurs so that the user of that application knows that something happened. How can I get this in my C# UWP application?

Like in Yahoo Messenger, if you get a message then the message window blinks to get your focus, I want to use that effect in my application.

Universal Windows Platform (UWP)
{count} votes

2 answers

Sort by: Most helpful
  1. Fay Wang - MSFT 5,211 Reputation points
    2019-12-03T07:41:15.503+00:00

    Hello,​

    ​Welcome to our Microsoft Q&A platform!​

    Currently, there seems no api can blink your app's icon in Taskbar. If you want to achieve some eye-catching effects, you can use notification or make notification badges appear on your app's taskbar icon, but it is a static effect without animation. For more details, you can refer to this document.

    private void updateBadgeGlyph()  
    {​  
        string badgeGlyphValue = "attention";​  
    ​  
        XmlDocument badgeXml = ​  
            BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeGlyph);​  
    ​  
        Windows.Data.Xml.Dom.XmlElement badgeElement = ​  
            badgeXml.SelectSingleNode("/badge") as Windows.Data.Xml.Dom.XmlElement;​  
        badgeElement.SetAttribute("value", badgeGlyphValue);​  
    ​  
        BadgeNotification badge = new BadgeNotification(badgeXml);​  
    ​  
        BadgeUpdater badgeUpdater = ​  
            BadgeUpdateManager.CreateBadgeUpdaterForApplication();​  
    ​  
        badgeUpdater.Update(badge);​  
    ​  
    }  
    

    Thanks!

    1 person found this answer helpful.
    0 comments No comments

  2. MangoApps 91 Reputation points
    2019-12-05T07:03:08.017+00:00

    Is there a way to change color of that badge?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.