Ejemplo n.º 1
0
 private void CreateOverlayWindow()
 {
     if (_overlayWindow == null)
     {
         _overlayWindow = new OverlayWindow(this);
     }
     var 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;
 }
Ejemplo n.º 2
0
 private void DestroyOverlayWindow()
 {
     if (_overlayWindow != null)
     {
         _overlayWindow.Close();
         _overlayWindow = null;
     }
 }
        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 -= _model_PropertyChanged;
        }