WPF UserControls: Image disappears even with 'x:Shared="False"' <p>I defined a style in a <code>ResourceDictionary</code> for a button with an image:</p> <pre><code>&lt;Style x:Key="BotonIrAInicioStyle" TargetType="Button"&gt; &lt;Setter Property="Margin" Value="0"/&gt; &lt;Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}"/&gt; &lt;Setter Property="Content"&gt; &lt;Setter.Value&gt; &lt;Image Margin="2" Source="{StaticResource IconoDashboardBlanco}" MaxHeight="20" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality"/&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>The image source is defined in another <code>ResourceDictionary</code> in the same assembly, and marked as <code>x:Shared="False"</code>:</p> <pre><code>&lt;BitmapImage x:Key="IconoDashboardBlanco" x:Shared="False" UriSource="pack://application:,,,/QualityFramework;component/Images/dashboard64X64.png"/&gt; </code></pre> <p>Since the style will be used in a different assembly, I used the <code>"pack://application:,,,"</code> notation to reference the image. The <code>Build Action</code> for the image is set to <code>Resource (Do not copy to output directory)</code>.</p> <p>In the main assembly I have two <code>UserControls</code> which display a button with identical style:</p> <pre><code>&lt;Button DockPanel.Dock="Left" Style="{StaticResource BotonIrAInicioStyle}" Click="BotonIrAInicio_Click"/&gt; (Click event has nothing to do with the problem) </code></pre> <p><strong>PROBLEM:</strong></p> <p>I open <code>UserControl A</code> containing the button with the image and the image is displayed ok. Then I open <code>UserControl B</code> containing an identical button, image ok. I open <code>UserControl A</code> again, and the image is gone. Happens the same if I open <code>UserControl B</code> and then <code>UserControl A</code>, the last one "owns" the image.</p> <p>I went everywhere and all the solutions point to the <code>x:Shared="False"</code>, the <code>URI notation</code> and the <code>Build Action</code>... I applied all of them and the problem still happens. I also tried cleaning and rebuilding with no success.</p> <p>What am I missing? Thanks!</p> <p>PS: if I set the content of both buttons to the image directly it works ok, but the whole point of styling is to avoid exactly that!</p>