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();
     }
 }
Example #3
0
        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();
            }
        }
Example #4
0
        void CleanUp()
        {
            if (_initialized)
            {
                if (_window != null)
                {
                    _window.Closing -= Window_Closing;
                }
                _initialized = false;

                image.Source = null;
                _dragHelper.FinalizeHelper();

                DiscardDeviceResources();

                ClearSavedCopy();
                _bitmap.Dispose();

                DiscardDeviceIndependentResources();
            }
        }