Exemplo n.º 1
0
 protected virtual void OnDragStart(DragStartEventArgs e)
 {
     if (DragStart != null)
     {
         DragStart(this, e);
     }
 }
Exemplo n.º 2
0
        private void Sample_MouseDown(object sender, MouseEventArgs e)
        {
            SampleVM vm = DataContext as SampleVM;

            if (vm != null)
            {
                if (e.RightButton == MouseButtonState.Pressed)
                {
                    if (vm.EditingRequested != null)
                    {
                        vm.EditingRequested.Execute(vm);
                    }
                }
                else if (e.LeftButton == MouseButtonState.Pressed)
                {
                    if (vm.DragStarted != null)
                    {
                        DragStartEventArgs dsea = new DragStartEventArgs();
                        dsea.FrameworkElement = sender as FrameworkElement;
                        dsea.GetEventPoint    = (elem => e.GetPosition(elem));
                        vm.DragStarted.Execute(dsea);
                    }
                }
            }
            e.Handled = true;
        }
Exemplo n.º 3
0
            protected override void OnDragStart(DragStartEventArgs <TabControl, Tab> e)
            {
                Point tabLocation    = e.DragParent.PointToScreen(e.DragParent._painter.GetTabPath(e.DragItemIndex).Bounds.Location);
                int   draggingOffset = e.DragStartPosition.X - tabLocation.X;

                e.DragItem.Dragging       = true;
                e.DragItem.DraggingOffset = draggingOffset;
                e.DragItem.DraggingX      = 0;
            }
Exemplo n.º 4
0
        private void HandleTabControlDragStart(object sender, DragStartEventArgs e)
        {
            var selectedTab = _tabControl.SelectedTab;

            if (selectedTab != null)
            {
                if (IsMemoTabPage(selectedTab))
                {
                    var pageContent = (PageContent)selectedTab.Tag;
                    var memoInfo    = pageContent.MemoInfo;
                    e.DragDataObjects = new[] {
                        new[] { memoInfo },
                    };
                    e.AllowedEffect = DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Link;
                }
            }
        }
Exemplo n.º 5
0
        private void Sample_TouchDown(object sender, TouchEventArgs e)
        {
            System.Diagnostics.Trace.WriteLine("label touched");
            SampleVM vm = DataContext as SampleVM;

            if (vm != null)
            {
                if (vm.DragStarted != null)
                {
                    DragStartEventArgs dsea = new DragStartEventArgs();
                    dsea.FrameworkElement = sender as FrameworkElement;
                    dsea.GetEventPoint    = (elem => e.GetTouchPoint(elem).Position);
                    vm.DragStarted.Execute(dsea);
                    e.Handled = true;
                }
            }
        }
Exemplo n.º 6
0
 void treeview_DragStart(object sender, DragStartEventArgs e)
 {
     e.CancelDrag = !AllowDragging;
 }
 void PlaceVisual_DragStart(object sender, DragStartEventArgs e)
 {
     //draggingStartRelativePosition = RelativePosition;
     draggingStartPosition = Position;
 }