title: Invalidating WinUI/UWP BitmapImage cache
body: <p>I'm trying to work out a way of invalidating the cache for a BitmapImage. My suspicion is that under the covers, this is implemented by something akin to a dictionary of path to memory stream, and when I recreate the <code>BitmapImage</code> with the same path it's just reading the cached stream without noticing that the image on the file system has changed.</p>
  <p>I know that I can work around this with code like this:</p>
  <pre><code>var bi = new BitmapImage();
  if(!initialLoad)
     bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
  bi.UriSource = new Uri(absolutePath);
  return bi;
  </code></pre>
  <p>The problem with the above is that it always ignores the cache and loads it fresh. What I'd like is for a way to invalidate the image cache when the image changes, but then keep the image in the cache.</p>
  <p>The image is being loaded from the file system.</p>
  <p>Is that possible?</p>