Exemple #1
0
        public static void Detach(PopupDragDrop pdd)
        {
            if (pdd == null || pdd._popup == null || pdd._popup.Child == null)
            {
                return;
            }

            pdd._popup.Child.MouseLeftButtonDown -= pdd.MouseLeftButtonDown;
            pdd._popup.Child.MouseLeftButtonUp -= pdd.MouseLeftButtonUp;
            pdd._popup.Child.MouseMove -= pdd.MouseMove;
        }
Exemple #2
0
        public static void Detach(PopupDragDrop pdd)
        {
            if (pdd == null || pdd._popup == null || pdd._popup.Child == null)
            {
                return;
            }

            pdd._popup.Child.MouseLeftButtonDown -= pdd.MouseLeftButtonDown;
            pdd._popup.Child.MouseLeftButtonUp   -= pdd.MouseLeftButtonUp;
            pdd._popup.Child.MouseMove           -= pdd.MouseMove;
        }
Exemple #3
0
        public static PopupDragDrop Attach(Popup popup)
        {
            if (popup == null || popup.Child == null || !(popup.Child is FrameworkElement))
            {
                return null;
            }

            var pdd = new PopupDragDrop
            {
                _popup = popup
            };

            pdd._popup.Child.MouseLeftButtonDown += pdd.MouseLeftButtonDown;
            pdd._popup.Child.MouseLeftButtonUp += pdd.MouseLeftButtonUp;
            pdd._popup.Child.MouseMove += pdd.MouseMove;

            return pdd;
        }
Exemple #4
0
        public static PopupDragDrop Attach(Popup popup)
        {
            if (popup == null || popup.Child == null || !(popup.Child is FrameworkElement))
            {
                return(null);
            }

            var pdd = new PopupDragDrop
            {
                _popup = popup
            };

            pdd._popup.Child.MouseLeftButtonDown += pdd.MouseLeftButtonDown;
            pdd._popup.Child.MouseLeftButtonUp   += pdd.MouseLeftButtonUp;
            pdd._popup.Child.MouseMove           += pdd.MouseMove;

            return(pdd);
        }