microsoft / microsoft/WindowsAppSDK
Svg image used in toast notification failed to render when pop up the first time
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 471
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 28
Description
### Describe the bug
I have a clean install of windows 10 18363. I found out my svg image used in a toast notification will fail to render (only showing a background color but not the shape) when it is shown the first time. This is extremely bothering.
Successive notification will show up correctly as expected.
### Steps to reproduce the bug
1. Create a new packaged winui3 C++ project
2. In the button handler, use this code
```cpp
void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&)
{
winrt::Windows::Data::Xml::Dom::XmlDocument doc;
doc.LoadXml(LR"(
Matt sent you a friend request
Hey, wanna dress up as wizards and ride around on our hoverboards together?
)");
winrt::Windows::UI::Notifications::ToastNotification notification{doc};
winrt::Windows::UI::Notifications::ToastNotificationManager::CreateToastNotifier()
.Show(
notification
);
}
```
3. Buld the app, click the button. See the toast.
The svg I am using:

### Expected behavior
_No response_
### Screenshots
1. First time
https://github.com/user-attachments/assets/5bc9d157-b7f8-4f52-b94f-4c1e3623c91c
2. Second time

### NuGet package version
Windows App SDK 1.5.5: 1.5.240627000
### Packaging type
Packaged (MSIX)
### Windows version
Windows 10 version 1909 (18363, November 2019 Update)
### IDE
Visual Studio 2022
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with a packaged WinUI 3 C++ app on Windows 10 version 1909, using the button handler and SVG toast markup shown in the report. Start at ToastNotificationManager and compare the first notification with successive notifications. Done means the SVG renders correctly on the first display as well as later displays.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100