void Page_Unloaded(object sender, RoutedEventArgs e) { if (_initialized) { _initialized = false; _dragHelper.FinalizeHelper(); CleanImageSource(); _bitmap.Dispose(); } }
void CleanUp() { if (_initialized) { if (_window != null) { _window.Closing -= Window_Closing; } _initialized = false; _dragHelper.FinalizeHelper(); image.Source = null; _bitmap.Dispose(); } }
void Page_Unloaded(object sender, RoutedEventArgs e) { if (_initialized) { if (_app != null) { _app.Suspending -= App_Suspending; } _initialized = false; _dragHelper.FinalizeHelper(); DiscardDeviceResources(); ClearSavedCopy(); _bitmap.Dispose(); DiscardDeviceIndependentResources(); } }
void CleanUp() { if (_initialized) { if (_window != null) { _window.Closing -= Window_Closing; } _initialized = false; image.Source = null; _dragHelper.FinalizeHelper(); DiscardDeviceResources(); ClearSavedCopy(); _bitmap.Dispose(); DiscardDeviceIndependentResources(); } }