Exemple #1
0
 /// <summary>
 /// WindowsXamlHost Dispose
 /// </summary>
 /// <param name="disposing">Is disposing?</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && !IsDisposed)
     {
         IsDisposed = true;
         desktopWindowXamlSource.TakeFocusRequested -= OnTakeFocusRequested;
         XamlRootInternal = null;
         desktopWindowXamlSource.Dispose();
         desktopWindowXamlSource = null;
     }
 }
        /// <summary>
        /// Cleanup hosted XAML content
        /// </summary>
        /// <param name="disposing">IsDisposing?</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                SizeChanged -= WindowsXamlHost_SizeChanged;

                desktopWindowXamlSource?.Dispose();
            }

            base.Dispose(disposing);
        }
Exemple #3
0
        /// <summary>
        /// WindowsXamlHost Dispose
        /// </summary>
        /// <param name="disposing">Is disposing?</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                ChildInternal = null;

                // Required by CA2213: _xamlSource?.Dispose() is insufficient.
                if (_xamlSource != null)
                {
                    _xamlSource.TakeFocusRequested -= OnTakeFocusRequested;
                    _xamlSource.Dispose();
                }
            }

            // BUGBUG: CoreInputSink cleanup is failing when explicitly disposing
            // WindowsXamlManager.  Add dispose call back when that bug is fixed in 19h1.
            base.Dispose(disposing);
        }
Exemple #4
0
        /// <summary>
        /// WindowsXamlHost Dispose
        /// </summary>
        /// <param name="disposing">Is disposing?</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && !this.IsDisposed)
            {
                var currentRoot = (WUX.FrameworkElement)ChildInternal;
                if (currentRoot != null)
                {
                    currentRoot.SizeChanged -= XamlContentSizeChanged;
                }

                // Free any other managed objects here.
                ComponentDispatcher.ThreadFilterMessage -= this.OnThreadFilterMessage;
                ChildInternal = null;
                if (_xamlSource != null)
                {
                    _xamlSource.TakeFocusRequested -= OnTakeFocusRequested;
                }

                if (_parentWindow != null)
                {
                    _parentWindow.Closed -= this.OnParentClosed;
                    _parentWindow         = null;
                }
            }

            // Free any unmanaged objects here.
            if (_xamlSource != null && !this.IsDisposed)
            {
                _xamlSource.Dispose();
            }

            // BUGBUG: CoreInputSink cleanup is failing when explicitly disposing
            // WindowsXamlManager.  Add dispose call back when that bug is fixed in 19h1.
            this.IsDisposed = true;

            // Call base class implementation.
            base.Dispose(disposing);
        }