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

            if (_mainWindow != null) {
                _mainWindow.AllowDrop = true;
                _mainWindow = null;
            }
        }
Exemple #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;
            }
        }
Exemple #3
0
        public void Dispose()
        {
            if (_dragPopup != null)
            {
                _dragPopup.Dispose();
                _dragPopup = null;
            }

            if (_mainWindow != null)
            {
                _mainWindow.AllowDrop = true;
                _mainWindow           = null;
            }
        }
Exemple #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;
            }
        }