次のように、WPF アプリケーションで静的リソースをセットアップしました。
<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>
次の宣言を使用して、設計時に表示される画像を確認できます。
<Image HorizontalAlignment="Left" Height="302" Margin="0,-106,0,0" VerticalAlignment="Top" Width="458" Source="{StaticResource logo}" Grid.RowSpan="2"/>
しかし、アプリケーションを実行すると、画像が表示されません。私が間違ったことをしたアイデアはありますか?
前もって感謝します!