I can't seem to make my WinUI 3 Button display an image.
My project is a packaged C# WinUI 3 desktop application.
Here is my XAML code (copied almost directly from the Microsoft docs):
<Button Style="{StaticResource AccentButtonStyle}" AutomationProperties.Name="Pie">
<StackPanel>
<Image Source="/Assets/settings-gear.png" Height="52"/>
<TextBlock Text="Slices" Foreground="Black" HorizontalAlignment="Center"/>
</StackPanel>
</Button>
And I'm not using any C# code on it, so that isn't the problem.
Yet my button looks like this:
Here's the .png
file I'm using as an icon:
What could be going wrong here?
Try these steps: