Hello,
I am making a game, and want to unload images when they aren't needed.
For now I am just setting their sources to null:
- imgExample.Source = null;
But this isn't enough.
I already tried Freezing, but it doesn't seem to help much.
I read that their is such thing like "Dispose()" that seem to unload all the memory, in such cases, but I don't know how to use it.
I tried:
- imgExample.Dispose();
But it didn't work, it seems I am missing either some kind of variable, or a using directive.
What can be done in this situation?

Amresh SRank #5,790 · 286 reputationPosted Sep 11, 2017, 1:10 AM EDT
Amresh SRank #5,790 · 286 reputationPosted Sep 11, 2017, 1:59 AM EDT
Evgenie Tivaniuk79 reputationPosted Sep 11, 2017, 1:51 AM EDT
Evgenie Tivaniuk79 reputationPosted Sep 11, 2017, 10:09 AM EDT
@Amresh S