問題の画像は、これと同様の ResourceDictionary 内の ControlTemplate にあります (明確にするためにさまざまな詳細が削除されています)。
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<ControlTemplate x:Key="ImageTestTemplate" TargetType="ImageTest">
<Grid>
<Image Source="/MyAssembly;Component/Images/MyImage.png"/>
</Grid>
</ControlTemplate>
</ResourceDictionary>
Expression Blend でコントロールを表示すると画像は正常に表示されますが、アプリを実行すると画像が表示されません。同じ画像を UserControl にドロップすると、問題なく表示されるため、問題はテンプレートの使用に関係しています。
テンプレート内に画像リソースをロードする必要がある他の方法はありますか?