Yesterday I tested SVG support in WPF app (.Net Core 3.0 or/and .Net Framework 4.8) and none seems to support an Image xaml tag with an .svg ressource, while UWP project does support it.
Does anyone know when SVG will be supported in WPF project?
- I have VS 2019 16.3.6 (the most recent)
- I don't want to convert it. I would like (prefer) to use the same technology as the one used in UWP where SVG is displayed into Directx by the OS directly.
- I thought unification of .net framework into Core would have brings us SVG support.
Sample code WPF with .Net framework 4.8:
<Window x:Class="WpfAppTestSvg.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfAppTestSvg"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Image Source="Images\w.svg" Width="200" Height="200"></Image>
</Grid>
</Window>
Sample code WPF with Core .Net 3.0
<Window x:Class="WpfAppWithDotNetCore.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfAppWithDotNetCore"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Image Source="Images\w.svg"></Image>
</Grid>
</Window>