microsoft / microsoft/microsoft-ui-xaml

ImageIconSource can not load svg within IconSourceElement

Open
#10,081 6 comments 1 reaction 0 assignees View on GitHub
area-ImageIcon bug team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

Can not load svg via ImageIconSource and **IconSourceElement** like:
```xml

```
or
```csharp
var element = new IconSourceElement();
var source = new ImageIconSource() {
ImageSource = new SvgImageSource(new Uri("ms-appx:///Assets/Svg/360.svg"))
};
element.IconSource = source;
```
but the Image and ImageIcon work:
```xml

```

### Steps to reproduce the bug

follow above.

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

### Windows version

Windows 11 (22H2): Build 22621

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with IconSourceElement and ImageIconSource using the XML and C# examples in the report on WinUI 3 / Windows App SDK 1.6.1. Compare the SVG behavior with the working Image and ImageIcon examples; done means the SVG loads through both IconSourceElement usage patterns.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.