0

I use the prism.Unity (WPF).

I show a image in ViewA, And I want to Delete the image in ViewB

When I jump from ViewA to ViewB and delete this image

The Vistual Studio tip: The process cannot access the file '...\bin\Debug\netcoreapp3.1\Images\1.png' because it is being used by another process.

In other words, the image(Xaml) data of viewA is not been destroyed, What should I do?

// App.Xaml.cs
containerRegistry.RegisterForNavigation<ViweA>();
containerRegistry.RegisterForNavigation<ViweB>();

// ViewAViewModel.cs

_regionManager.RequestNavigate("ContentRegion", "ViweB");

ViewA and ViewB Image

  • Does this answer your question? [Prism DI container - dispose unnecessary objects](https://stackoverflow.com/questions/43936976/prism-di-container-dispose-unnecessary-objects) – Rekshino Jun 30 '20 at 13:52
  • @Rekshino , Thank you, but it can't solve my problem – shiliu san Jul 01 '20 at 05:26

0 Answers0