I saw tons of threads with memory leaking while using images. So, is it a good idea just to have a general function, some kind of own GC, which would run at NavigatingFrom, fin
Here is an helper to iterate throught all the images of your page:
public IEnumerable<Image> GetAllImage(DependencyObject root)
{
var count = VisualTreeHelper.GetChildrenCount(parentElement);
for (int i = 0; i < count; i++)
{
var child = VisualTreeHelper.GetChild(parentElement, i);
if (child is Image)
{
yield return (Image)child;
}
foreach (var image in GetAllImage(child))
{
yield return image;
}
}
}
You can just call it with the root of your page as parameter and it should return all the images to you.