{"Cannot locate resource 'resources/image.svg'."}
<Window x:Class="TestLayout.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:TestLayout" xmlns:svgc="http://sharpvectors.codeplex.com/svgc/" mc:Ignorable="d" Title="TestLayout" Height="450" Width="800"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="50" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <StackPanel Grid.Row="1" Orientation="Vertical"> <Button Margin="10"> <svgc:SvgViewbox Height="20" Width="20" Source="Resources/image.svg"/> </Button> </StackPanel> </Grid> </Window>
Absolute vs. Relative Pack URIs | Pack URIs - WPF .NET Framework | Microsoft Docs[^]: By default, a relative pack URI is considered relative to the location of the markup or code that contains the reference.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)