when switch source,seems the old value does not dispose:the memory has not decreased. (wait some minutes also not)
the code is very simple and nothing special:
private void Button_Click(object sender, RoutedEventArgs e)
{
var dialog = new OpenFileDialog();
if (dialog.ShowDialog() == true)
{
var source = new BitmapImage(new Uri(dialog.FileName));
ImageBehavior.SetRepeatBehavior(img, System.Windows.Media.Animation.RepeatBehavior.Forever);
ImageBehavior.SetAutoStart(img, true);
ImageBehavior.SetAnimatedSource(img, source);
}
}
when switch source,seems the old value does not dispose:the memory has not decreased. (wait some minutes also not)
the code is very simple and nothing special: