Reputation: 7237
I have setup static resources in my WPF application as follows:
<Application x:Class="Demos.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<BitmapImage x:Key="logo" UriSource="Logo.png" />
</Application.Resources>
</Application>
I can see the images appearing at design time with the following declaration:
<Image HorizontalAlignment="Left" Height="302" Margin="0,-106,0,0" VerticalAlignment="Top" Width="458" Source="{StaticResource logo}" Grid.RowSpan="2"/>
But when I run my application the images aren't appearing. Any ideas what I've done wrong?
Thanks in advance!
Upvotes: 2
Views: 2696
Reputation: 9242
Make Image Properties to Resource and Copy Always from Property Windows. Hope this solve your problem.
Upvotes: 2