Example #1
0
        /// <summary>
        /// The detach.
        /// </summary>
        /// <param name="pdd">
        /// The pdd.
        /// </param>
        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;
        }
Example #2
0
        /// <summary>
        /// The detach.
        /// </summary>
        /// <param name="pdd">
        /// The pdd.
        /// </param>
        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;
        }
Example #3
0
        /// <summary>
        /// The attach.
        /// </summary>
        /// <param name="popup">
        /// The popup.
        /// </param>
        /// <returns>
        /// The <see cref="PopupDragDrop"/>.
        /// </returns>
        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;
        }
Example #4
0
        /// <summary>
        /// The attach.
        /// </summary>
        /// <param name="popup">
        /// The popup.
        /// </param>
        /// <returns>
        /// The <see cref="PopupDragDrop"/>.
        /// </returns>
        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);
        }