Exemple #1
0
        public static void OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            dragInfo = new DragInfo(sender, e);

            var uiElement = sender as UIElement;

            if (uiElement == null)
            {
                e.Handled = true;
                return;
            }

            var passClickEventToParent = GetPassClickEventToParent(uiElement);

            if (!passClickEventToParent)
            {
                e.Handled = true;
            }
        }
Exemple #2
0
        private static void OnDragDrop(object sender, DragEventArgs e)
        {
            var uiElement = sender as UIElement;

            if (uiElement == null)
            {
                return;
            }

            UpdateTargetDataContext <StatInfo>(sender, x => x.IsSelected = false);

            var dragDropCommand = GetDragDropCommand(uiElement);

            if (dragDropCommand != null)
            {
                var dragDropDataObject = CreateDragDropDataObject(uiElement, e);

                dragDropCommand.Execute(dragDropDataObject);
            }

            DragAdorner = null;
            dragInfo    = null;
            e.Handled   = true;
        }