How to reload Image without changing the Source property in WPF?
<p>Assume I have an <code>Image</code> object which his <code>Source</code> property being initialized in the following way:</p>

<pre><code>BitmapImage source = new BitmapImage();
source.BeginInit();
source.CacheOption = BitmapCacheOption.OnLoad;
source.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
source.UriSource = new Uri("C:\\Temp\\tech\\window.jpg");
source.EndInit();
image.Source = source; // image object automatically initialized in the window construction.
</code></pre>

<p>As you can implicitly see, <code>window.jpg</code> is an image that permanently changed (get deleted and replaced with a new different image <em>with the same name</em>).</p>

<p>I have been using the above mentioned way to initialize the <code>Image</code> object <code>Source</code> property because I have found it at <a href="https://stackoverflow.com/questions/10518986/image-does-not-refresh-in-custom-picture-box">Image does not refresh in custom picture box</a> as a way to support the <code>Image</code> refreshing.</p>

<p>However, when deleting and replacing <code>window.jpg</code> while the program is running, the <code>Image</code> object still shows the image that was loaded when we initialized its <code>Source</code> property (cache).</p>

<p>It seems like the <code>Image</code> object ignores the <code>BitmapCreateOptions.IgnoreImageCache</code> value and doesn't refresh the image when a new one replacing the previous that was deleted.</p>

<p>Any solution will be welcomed.</p>

<p><strong>EDIT</strong></p>

<p>I don't want to change the filename because I would need to redundantly find a random name that doesn't exist instead of just refreshing the image to load the same <code>Source</code> again.</p>

<p>I don't want to change the <code>Source</code> property value because of the fact that I don't change the filename.</p>

<p>The desired solution is to update the  <code>Image</code> object each time the image file changes. The image change controlled by me so there is no need to bind and wait for a change, instead, I would force an image refresh, if it possible.</p>