Skip to content

Updating toast progress bar from unpackaged desktop apps doesn't work when using Group+Tag #3835

@andrewleader

Description

@andrewleader

Describe the bug

When trying to use progress bars from an unpackaged C# app, the API to update the progress bar data doesn't actually update the progress bar when using Group+Tag. If the notification only uses Tag, it works fine. Works fine in packaged apps too, only unpackaged apps.

Steps to Reproduce

Steps to reproduce the behavior:

  1. In an unpackaged C# app using the 7.0 Notifications library...
  2. Show a toast using both Tag and Group that has a progress bar with data bound fields
  3. Attempt to update the toast data using Tag and Group
  4. Notice the toast doesn't update
const string tag = "progressToast";
const string group = "progressToastGroup";

new ToastContentBuilder()
    .AddArgument("action", "viewConversation")
    .AddArgument("conversationId", 423)
    .AddText("Sending image to conversation...")
    .AddVisualChild(new AdaptiveProgressBar()
    {
        Value = new BindableProgressBarValue("progress"),
        Status = "Sending..."
    })
    .Show(toast =>
    {
        toast.Tag = tag;
        toast.Group = group;

        toast.Data = new NotificationData(new Dictionary<string, string>()
        {
            { "progress", "0" }
        });
    });

double progress = 0;

while (progress < 1)
{
    await Task.Delay(new Random().Next(1000, 3000));

    progress += (new Random().NextDouble() * 0.15) + 0.1;

    ToastNotificationManagerCompat.CreateToastNotifier().Update(
        new NotificationData(new Dictionary<string, string>()
        {
            { "progress", progress.ToString() }
        }), tag, group);
}

Expected behavior

The toast progress bar should animate

Environment

NuGet Package(s): Notifications 7.0

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [x] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: ) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions