The Images are working in the MainPage, but I'm trying to Integrate it in an Navigational Panel Templete and the images don't show up. Can anyone suggest me what might be the problems.
The Templete's making use of FRAMES but that should not be the issues.
XAML code
<Button Grid.Column="0" Style="{StaticResource NavigationButtonStyle}">
<StackPanel Orientation="Horizontal">
<Image Source="Assets/donut-icon.png" Style="{StaticResource IconImageStyle}" />
<TextBlock Text="Donut" Foreground="White" />
</StackPanel>
</Button>
Styles Resources
<Style TargetType="Image" x:Key="IconImageStyle">
<Setter Property="Height" Value="20" />
<Setter Property="Width" Value="20" />
<Setter Property="Margin" Value="0,0,10,0" />
</Style>
Go to tool box and drag and drop the image into the designer page. In the solution explorer go to assets and right click. Then click add -> existing item. Browse the required file.
If you don't see the Blank App (Universal Windows) project template, click the Install more tools and features link. The Visual Studio Installer launches. Choose the Universal Windows Platform development workload, and then select Modify. Give the project a name, HelloWorld, and choose Create.
I noticed that your page is in your "Pages/Go Nuts" folder, so you should use following URI to get the image.
<Image Source="ms-appx:///Assets/donut-icon.png" />
Or
<Image Source="/Assets/donut-icon.png" />
While using <Image Source="Assets/donut-icon.png" />
it will search resource in current folder. But there is no such resource in current folder, so it won't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With