MainWindow.xaml:
<Window x:Class="MyApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Images.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid> <Button x:Name="RecStartButton" Content="Button" HorizontalAlignment="Left" Margin="209,43,0,0" VerticalAlignment="Top" Width="129" Height="67" Click="RecStart"/> <ListBox x:Name="FindedSong" HorizontalAlignment="Left" Height="100" Margin="172,174,0,0" VerticalAlignment="Top" Width="312"/> <Image x:Name="FindedSongPicture" HorizontalAlignment="Left" Height="100" Margin="45,174,0,0" VerticalAlignment="Top" Width="100"/> </Grid> </Window> Images.xaml:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ImageSource x:Key="NoAlbum">Resources/NoAlbum.png</ImageSource> </ResourceDictionary> I insert a picture in Image:
FindedSongPicture.Source = (ImageSource)FindResource("NoAlbum"); I receive:
What is the problem?


<BitmapImage x:Key="NoAlbum" UriSource="Resources/NoAlbum.png"/>. So in 2013 I took off. - VladD