/// <summary> /// Detaches the renderer from the current target panel. /// </summary> public void Detach() { try { if (m_targetPanel == null) { return; } // Clear view resources m_renderLoop.UnloadViewResources(); m_renderLoop.DeregisterRenderLoop(); // Clear event registrations m_targetPanel.SizeChanged -= OnTargetPanel_SizeChanged; m_targetPanel.Loaded -= OnTargetPanel_Loaded; m_targetPanel.Unloaded -= OnTargetPanel_Unloaded; m_targetPanel.CompositionScaleChanged -= OnTargetPanel_CompositionScaleChanged; //Clear created references m_observerSizeChanged.Dispose(); m_observerSizeChanged = null; m_targetPanel.Dispose(); m_targetPanel = null; } catch (Exception ex) { CommonTools.RaiseUnhandledException( this.GetType(), this, ex, "Detaching the FrozenSyBackgroundPanelPainter"); } }
/// <summary> /// Stops rendering to the target CoreWindow. /// </summary> public void Dispose() { if (m_isDisposed) { return; } m_isDisposed = true; m_targetWindow.SizeChanged -= OnTargetWindow_SizeChanged; m_displayInfo.DpiChanged -= OnDisplayInfo_DpiChanged; m_displayInfo.OrientationChanged -= OnDisplayInfo_OrientationChanged; // Clear view resources m_renderLoop.UnloadViewResources(); m_renderLoop.DeregisterRenderLoop(); }
public void Detach() { try { if (m_targetPanel == null) { return; } //// Deregister simple mouse movement //UnloadMouseMovement(); // Clear view resources m_renderLoop.UnloadViewResources(); m_renderLoop.DeregisterRenderLoop(); // Reset interop settings m_targetPanel.SetContentProvider(null); m_targetPanel.SetManipulationHandler(null); m_drawingInterop = null; // Clear event registrations m_targetPanel.SizeChanged -= OnTargetPanelSizeChanged; m_targetPanel.Loaded -= OnTargetPanelLoaded; m_targetPanel.Unloaded -= OnTargetPanelUnloaded; //Clear created references m_observerSizeChanged.Dispose(); m_observerSizeChanged = null; m_targetPanel = null; } catch (Exception ex) { CommonTools.RaiseUnhandledException( this.GetType(), this, ex, "Detaching the FrozenSyBackgroundPanelPainter"); } }