protected override void OnClosed(EventArgs e)
        {
            var root = Model.Root;
            root.Manager.RemoveFloatingWindow(this);
            root.CollectGarbage();
            if (_overlayWindow != null)
            {
                _overlayWindow.Close();
                _overlayWindow = null;
            }

            base.OnClosed(e);

            if (!CloseInitiatedByUser)
            {
                root.FloatingWindows.Remove(_model);
            }

            _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged);
        }
 void CreateOverlayWindow()
 {
     if (_overlayWindow == null)
         _overlayWindow = new OverlayWindow(this);
     Rect rectWindow = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
     _overlayWindow.Left = rectWindow.Left;
     _overlayWindow.Top = rectWindow.Top;
     _overlayWindow.Width = rectWindow.Width;
     _overlayWindow.Height = rectWindow.Height;
 }
示例#3
0
 void DestroyOverlayWindow()
 {
     if (_overlayWindow != null)
     {
         _overlayWindow.Close();
         _overlayWindow = null;
     }
 }