Inheritance: System.Windows.Controls.Primitives.Popup, IDisposable
Example #1
0
        public void Dispose() {
            if (_dragPopup != null) {
                _dragPopup.Dispose();
                _dragPopup = null;
            }

            if (_mainWindow != null) {
                _mainWindow.AllowDrop = true;
                _mainWindow = null;
            }
        }
Example #2
0
        public DragPreview([NotNull] UIElement item) {
            if (item == null) throw new ArgumentNullException(nameof(item));

            _dragPopup = new DragPopup(item.RenderSize, new VisualBrush(item));
            _dragPopup.UpdatePosition();

            _mainWindow = Application.Current.MainWindow;
            if (_mainWindow?.AllowDrop == true) {
                _mainWindow.AllowDrop = false;
            } else {
                _mainWindow = null;
            }
        }
Example #3
0
        public void Dispose()
        {
            if (_dragPopup != null)
            {
                _dragPopup.Dispose();
                _dragPopup = null;
            }

            if (_mainWindow != null)
            {
                _mainWindow.AllowDrop = true;
                _mainWindow           = null;
            }
        }
Example #4
0
        public DragPreview([NotNull] UIElement item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            _dragPopup = new DragPopup(item.RenderSize, new VisualBrush(item));
            _dragPopup.UpdatePosition();

            _mainWindow = Application.Current?.MainWindow;
            if (_mainWindow?.AllowDrop == true)
            {
                _mainWindow.AllowDrop = false;
            }
            else
            {
                _mainWindow = null;
            }
        }