• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Primitives.DragDeltaEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Controls.Primitives.DragDeltaEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DragDeltaEventArgs类的具体用法?C# DragDeltaEventArgs怎么用?C# DragDeltaEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DragDeltaEventArgs类属于System.Windows.Controls.Primitives命名空间,在下文中一共展示了DragDeltaEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: headerThumb_DragDelta

 private void headerThumb_DragDelta(object sender, DragDeltaEventArgs e)
 {
     var parentWindow = Window.GetWindow(this);
     if (parentWindow == null) return;
     parentWindow.Left += e.HorizontalChange;
     parentWindow.Top += e.VerticalChange;
 }
开发者ID:redinkinc,项目名称:Utilities,代码行数:7,代码来源:PCsettings.xaml.cs


示例2: ResizeThumb_DragDelta

        private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            if (this.designerItem != null && this.designerCanvas != null && this.designerItem.IsSelected)
            {
                double minLeft = double.MaxValue;
                double minTop = double.MaxValue;
                double minDeltaHorizontal = double.MaxValue;
                double minDeltaVertical = double.MaxValue;
                double dragDeltaVertical, dragDeltaHorizontal;

                foreach (DesignerItem item in this.designerCanvas.SelectedItems)
                {
                    if (!item.CanResize)
                        continue;

                    minLeft = Math.Min(Canvas.GetLeft(item), minLeft);
                    minTop = Math.Min(Canvas.GetTop(item), minTop);

                    minDeltaVertical = Math.Min(minDeltaVertical, item.ActualHeight - item.MinHeight);
                    minDeltaHorizontal = Math.Min(minDeltaHorizontal, item.ActualWidth - item.MinWidth);
                }

                foreach (DesignerItem item in this.designerCanvas.SelectedItems)
                {
                    if (!item.CanResize)
                        continue;

                    switch (VerticalAlignment)
                    {
                        case VerticalAlignment.Bottom:
                            dragDeltaVertical = Math.Min(-e.VerticalChange, minDeltaVertical);
                            item.Height = item.ActualHeight - dragDeltaVertical;
                            break;
                        case VerticalAlignment.Top:
                            dragDeltaVertical = Math.Min(Math.Max(-minTop, e.VerticalChange), minDeltaVertical);
                            Canvas.SetTop(item, Canvas.GetTop(item) + dragDeltaVertical);
                            item.Height = item.ActualHeight - dragDeltaVertical;
                            break;
                    }

                    switch (HorizontalAlignment)
                    {
                        case HorizontalAlignment.Left:
                            dragDeltaHorizontal = Math.Min(Math.Max(-minLeft, e.HorizontalChange), minDeltaHorizontal);
                            Canvas.SetLeft(item, Canvas.GetLeft(item) + dragDeltaHorizontal);
                            item.Width = item.ActualWidth - dragDeltaHorizontal;
                            break;
                        case HorizontalAlignment.Right:
                            dragDeltaHorizontal = Math.Min(-e.HorizontalChange, minDeltaHorizontal);
                            item.Width = item.ActualWidth - dragDeltaHorizontal;
                            break;
                    }

                    item.Width = (double)MathHelper.Clamp((float)item.Width, (float)item.MinWidth, (float)Math.Min(item.MaxWidth, designerCanvas.ActualWidth - Canvas.GetLeft(item)));
                    item.Height = (double)MathHelper.Clamp((float)item.Height, (float)item.MinHeight, (float)Math.Min(item.MaxHeight, designerCanvas.ActualHeight - Canvas.GetTop(item)));
                }

                e.Handled = true;
            }
        }
开发者ID:CrimsonChris,项目名称:Half-Caked,代码行数:60,代码来源:ResizeThumb.cs


示例3: MoveThumb_DragDelta

        private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            if (this.designerItem != null && this.designerCanvas != null && this.designerItem.IsSelected)
            {
                double minLeft = double.MaxValue;
                double minTop = double.MaxValue;

                foreach (DesignerItem item in this.designerCanvas.SelectedItems)
                {
                    minLeft = Math.Min(Canvas.GetLeft(item), minLeft);
                    minTop = Math.Min(Canvas.GetTop(item), minTop);
                }

                double deltaHorizontal = Math.Max(-minLeft, e.HorizontalChange);
                double deltaVertical = Math.Max(-minTop, e.VerticalChange);

                foreach (DesignerItem item in this.designerCanvas.SelectedItems)
                {
                    Canvas.SetLeft(item, Canvas.GetLeft(item) + deltaHorizontal);
                    Canvas.SetTop(item, Canvas.GetTop(item) + deltaVertical);
                }

                this.designerCanvas.InvalidateMeasure();
                e.Handled = true;
            }
        }
开发者ID:jgkim999,项目名称:WpfExample,代码行数:26,代码来源:MoveThumb.cs


示例4: DragDeltaHandle

        private void DragDeltaHandle(object sender, DragDeltaEventArgs e)
        {
            var control = this.TemplatedParent as DiagramItem;
            if (control != null) {
                var diagram = VisualTreeHelper.GetParent(control) as DiagramCanvas;
                if (diagram != null) {
                    double hDelta = control.ParentDiagram.StickToDiagramGrid ? 10 * Math.Ceiling(e.HorizontalChange / 10) : e.HorizontalChange;
                    double vDelta = control.ParentDiagram.StickToDiagramGrid ? 10 * Math.Ceiling(e.VerticalChange / 10) : e.VerticalChange;

                    bool isHorizontalMove = !control.ParentDiagram.StickToDiagramGrid || Math.Abs(e.HorizontalChange) > 5.0;
                    bool isVerticalMove = !control.ParentDiagram.StickToDiagramGrid || Math.Abs(e.VerticalChange) > 5.0;

                    foreach (var item in diagram.Children.OfType<DiagramItem>()) {
                        if (!item.IsSelected) continue;

                        double left = Canvas.GetLeft(item);
                        double top = Canvas.GetTop(item);

                        if (isHorizontalMove && left + hDelta > 0)
                            Canvas.SetLeft(item, left + hDelta);
                        if (isVerticalMove && top + vDelta > 0)
                            Canvas.SetTop(item, top + vDelta);
                    }

                    diagram.InvalidateMeasure();
                }
            }
        }
开发者ID:AleksandarDev,项目名称:Eve,代码行数:28,代码来源:DragThumb.cs


示例5: MoveThumb_DragDelta

        private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            if (this.element != null && this.canvasWorkspace != null && this.element.IsSelected)
            {
                double minLeft = double.MaxValue;
                double minTop = double.MaxValue;

                foreach (BaseObject item in this.canvasWorkspace.SelectedElements)
                {
                    minLeft = Math.Min(Canvas.GetLeft(item), minLeft);
                    minTop = Math.Min(Canvas.GetTop(item), minTop);
                }

                double deltaHorizontal = Math.Max(-minLeft, e.HorizontalChange);
                double deltaVertical = Math.Max(-minTop, e.VerticalChange);

                foreach (BaseObject item in this.canvasWorkspace.SelectedElements)
                {
                    Canvas.SetLeft(item, Canvas.GetLeft(item) + deltaHorizontal);
                    Canvas.SetTop(item, Canvas.GetTop(item) + deltaVertical);
                }

                this.canvasWorkspace.InvalidateMeasure();
                e.Handled = true;
            }
        }
开发者ID:AaronRevilla,项目名称:TT_2012b-049_ComputerGraphics,代码行数:26,代码来源:MoveThumb.cs


示例6: MoveThumbDragDelta

        private void MoveThumbDragDelta(object sender, DragDeltaEventArgs e)
        {
            var designerItem = DataContext as Control;
            var contentControl = DataContext as ContentControl;

            if (contentControl != null)
            {
                var displayItem = contentControl.Content as DisplayItem;
                if (displayItem != null)
                {
                    if (!displayItem.IsUnlocked)
                    {
                        return;
                    }
                }
            }

            if (designerItem != null)
            {
                var left = Canvas.GetLeft(designerItem);
                var top = Canvas.GetTop(designerItem);

                Canvas.SetLeft(designerItem, left + e.HorizontalChange);
                Canvas.SetTop(designerItem, top + e.VerticalChange);
            }
        }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:26,代码来源:MoveThumb.cs


示例7: MoveThumb_DragDelta

        private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            if (this.designerItem != null)
            {
                Point dragDelta = new Point(e.HorizontalChange, e.VerticalChange);

                if (this.rotateTransform != null)
                {
                    dragDelta = this.rotateTransform.Transform(dragDelta);
                }

                Canvas canvas = this.designerItem.Parent as Canvas;
                if (canvas == null)
                    return;

                Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + dragDelta.X);
                Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + dragDelta.Y);

                if (Canvas.GetLeft(this.designerItem) < 0)
                    Canvas.SetLeft(this.designerItem, 0);

                if (Canvas.GetLeft(this.designerItem) + this.ActualWidth > canvas.ActualWidth)
                    Canvas.SetLeft(this.designerItem, canvas.ActualWidth - this.ActualWidth);

                if (Canvas.GetTop(this.designerItem) < 0)
                    Canvas.SetTop(this.designerItem, 0);

                if (Canvas.GetTop(this.designerItem) + this.ActualHeight > canvas.ActualHeight)
                    Canvas.SetTop(this.designerItem, canvas.ActualHeight - this.ActualHeight);

            }
        }
开发者ID:apazureck,项目名称:bierstrichler,代码行数:32,代码来源:MoveThumb.cs


示例8: MoveThumb_DragDelta

        private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            Control tv = this.DataContext as Control;
            Canvas tvship = VisualTreeHelper.GetParent(tv) as Canvas;

            if (tv != null)
            {
                double left = Canvas.GetLeft(tv);
                double top = Canvas.GetTop(tv);

                double minLeft = double.IsNaN(left) ? 0 : left;
                double minTop = double.IsNaN(top) ? 0 : top;

                double deltaHorizontal = System.Math.Max(-minLeft, e.HorizontalChange);
                double deltaVertical = System.Math.Max(-minTop, e.VerticalChange);

                if (tvship != null && !double.IsNaN(tvship.Width) && !double.IsNaN(tvship.Height))
                {
                    deltaHorizontal = System.Math.Min(tvship.Width - left - tv.Width, deltaHorizontal);
                    deltaVertical = System.Math.Min(tvship.Height - top - tv.Height, deltaVertical);
                }
                Canvas.SetLeft(tv, left + deltaHorizontal);
                Canvas.SetTop(tv, top + deltaVertical);
            }
        }
开发者ID:palome06,项目名称:psd48,代码行数:25,代码来源:MovePanelThumb.cs


示例9: ThumbOnDragDelta

        private void ThumbOnDragDelta(object sender, DragDeltaEventArgs dragDeltaEventArgs)
        {
            var thumb = (Thumb)sender;

            var hook = GetHookPointFromAlignments(thumb.HorizontalAlignment, thumb.VerticalAlignment);

            if (IsASideHook(hook))
            {
                designable.AnchorPoint = hook;

                if (IsHorizontalHook(hook))
                {
                    var widthDelta = (0.5 - hook.X) * 2 * dragDeltaEventArgs.HorizontalChange;
                    designable.Width += widthDelta ;
                }

                if (IsVerticalHook(hook))
                {
                    var heightDelta = (0.5 - hook.Y) * 2 * dragDeltaEventArgs.VerticalChange;
                    designable.Height += heightDelta;
                }
            }
            else
            {
                var leftDelta = dragDeltaEventArgs.HorizontalChange;
                var topDelta = dragDeltaEventArgs.VerticalChange;

                designable.Left += leftDelta;
                designable.Top += topDelta;
            }

            dragDeltaEventArgs.Handled = true;
        }
开发者ID:modulexcite,项目名称:Glass-Legacy,代码行数:33,代码来源:DesignableResizeChrome.cs


示例10: DragThumb_DragDelta

        void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            DesignerItemViewModelBase designerItem = this.DataContext as DesignerItemViewModelBase;

            if (designerItem != null && designerItem.IsSelected)
            {
                double minLeft = double.MaxValue;
                double minTop = double.MaxValue;

                // we only move DesignerItems
                var designerItems = designerItem.SelectedItems;

                foreach (DesignerItemViewModelBase item in designerItems.OfType<DesignerItemViewModelBase>())
                {
                    double left = item.Left;
                    double top = item.Top;
                    minLeft = double.IsNaN(left) ? 0 : Math.Min(left, minLeft);
                    minTop = double.IsNaN(top) ? 0 : Math.Min(top, minTop);

                    double deltaHorizontal = Math.Max(-minLeft, e.HorizontalChange);
                    double deltaVertical = Math.Max(-minTop, e.VerticalChange);
                    item.Left += deltaHorizontal;
                    item.Top += deltaVertical;

                }
                e.Handled = true;
            }
        }
开发者ID:worktycho,项目名称:didactic-palm-tree,代码行数:28,代码来源:DragThumb.cs


示例11: DragThumb_DragDelta

        void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            ItemsControl item = this.DataContext as ItemsControl;

            ContentPresenter contentPresenter = VisualTreeHelper.GetParent(item) as ContentPresenter;

            double minLeft = double.MaxValue;
            double minTop = double.MaxValue;
            double left = Canvas.GetLeft(contentPresenter);
            double top = Canvas.GetTop(contentPresenter);

            minLeft = double.IsNaN(left) ? 0 : Math.Min(left, minLeft);
            minTop = double.IsNaN(top) ? 0 : Math.Min(top, minTop);

            double deltaHorizontal = Math.Max(-minLeft, e.HorizontalChange);
            double deltaVertical = Math.Max(-minTop, e.VerticalChange);

            if (double.IsNaN(left)) left = 0;
            if (double.IsNaN(top)) top = 0;

            Canvas.SetLeft(contentPresenter, left + deltaHorizontal);
            Canvas.SetTop(contentPresenter, top + deltaVertical);

            e.Handled = false;
        }
开发者ID:hardborn,项目名称:StadiumBrightnessTool,代码行数:25,代码来源:DragThumb.cs


示例12: DragablzDragDeltaEventArgs

        public DragablzDragDeltaEventArgs(DragablzItem dragablzItem, DragDeltaEventArgs dragDeltaEventArgs)
            : base(dragablzItem)
        {
            if (dragDeltaEventArgs == null) throw new ArgumentNullException("dragDeltaEventArgs");

            _dragDeltaEventArgs = dragDeltaEventArgs;
        }
开发者ID:CensoredHF,项目名称:Snappie,代码行数:7,代码来源:DragablzDragDeltaEventArgs.cs


示例13: PART_RESIZE_BOTRIGHT_DragDelta

        private void PART_RESIZE_BOTRIGHT_DragDelta(object sender, DragDeltaEventArgs e)
        {
            Thumb _thumb = (Thumb)sender;

            if (_thumb != null)
            {
                Window _window = Window.GetWindow(_thumb);

                if (_window != null && _window.IsInitialized)
                {
                    double _newWidth = _window.Width + e.HorizontalChange;

                    if (_newWidth > 0)
                    {
                        _window.Width = _newWidth > _window.MinWidth ? _newWidth : _window.MinWidth;
                    }

                    double _newHeight = _window.Height + e.VerticalChange;

                    if (_newHeight > 0)
                    {
                        _window.Height = _newHeight > _window.MinHeight ? _newHeight : _window.MinHeight;
                    }
                }
            }
        }
开发者ID:ArcadeRenegade,项目名称:SidebarDiagnostics,代码行数:26,代码来源:FlatStyle.xaml.cs


示例14: ResizeThumb_DragDelta

    private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e)
    {
      var designerItem = DataContext as DesignerItem;
      var designer = VisualTreeHelper.GetParent(designerItem) as DesignerCanvas;

      if (designerItem != null && designer != null && designerItem.IsSelected)
      {
        double minLeft, minTop, minDeltaHorizontal, minDeltaVertical;
        double dragDeltaVertical, dragDeltaHorizontal, scale;

        var selectedDesignerItems = designer.SelectionService.CurrentSelection.OfType<DesignerItem>();

        CalculateDragLimits(selectedDesignerItems,
          out minLeft,
          out minTop,
          out minDeltaHorizontal,
          out minDeltaVertical);

        foreach (var item in selectedDesignerItems)
        {
          if (item != null && item.ParentID == Guid.Empty)
          {
            switch (VerticalAlignment)
            {
              case VerticalAlignment.Bottom:
                dragDeltaVertical = Math.Min(-e.VerticalChange, minDeltaVertical);
                scale = (item.ActualHeight - dragDeltaVertical)/item.ActualHeight;
                DragBottom(scale, item, designer.SelectionService);
                break;
              case VerticalAlignment.Top:
                var top = Canvas.GetTop(item);
                dragDeltaVertical = Math.Min(Math.Max(-minTop, e.VerticalChange), minDeltaVertical);
                scale = (item.ActualHeight - dragDeltaVertical)/item.ActualHeight;
                DragTop(scale, item, designer.SelectionService);
                break;
              default:
                break;
            }

            switch (HorizontalAlignment)
            {
              case HorizontalAlignment.Left:
                var left = Canvas.GetLeft(item);
                dragDeltaHorizontal = Math.Min(Math.Max(-minLeft, e.HorizontalChange), minDeltaHorizontal);
                scale = (item.ActualWidth - dragDeltaHorizontal)/item.ActualWidth;
                DragLeft(scale, item, designer.SelectionService);
                break;
              case HorizontalAlignment.Right:
                dragDeltaHorizontal = Math.Min(-e.HorizontalChange, minDeltaHorizontal);
                scale = (item.ActualWidth - dragDeltaHorizontal)/item.ActualWidth;
                DragRight(scale, item, designer.SelectionService);
                break;
              default:
                break;
            }
          }
        }
        e.Handled = true;
      }
    }
开发者ID:WinnieThePoooh,项目名称:Lego,代码行数:60,代码来源:ResizeThumb.cs


示例15: OnMoveThumbDragDelta

      private void OnMoveThumbDragDelta(object sender, DragDeltaEventArgs e)
      {
         var window = VisualTreeExtension.FindMdiWindow(this);

         if (window != null)                  
         {
             

                if (window.WindowState == WindowState.Maximized)
            {
               window.Normalize();
            }

            if (window.WindowState != WindowState.Minimized)
            {
                   
               window.LastLeft = Canvas.GetLeft(window);
               window.LastTop = Canvas.GetTop(window);


               var  candidateLeft =  window.LastLeft + e.HorizontalChange;
               var candidateTop = window.LastTop + e.VerticalChange;

               Canvas.SetLeft(window, Math.Min(Math.Max(0,candidateLeft), window.Container.ActualWidth -25));
               Canvas.SetTop(window, Math.Min(Math.Max(0, candidateTop), window.Container.ActualHeight  - 25));
            }
         }
      }
开发者ID:epinoema,项目名称:Hammer.MdiContainer,代码行数:28,代码来源:MoveThumb.cs


示例16: Thumb_Drag

 void Thumb_Drag(object sender, DragDeltaEventArgs e)
 {
     Canvas.SetRight(MyThumb, Canvas.GetRight(MyThumb) - e.HorizontalChange);
     //Canvas.SetTop(MyThumb, Canvas.GetTop(MyThumb) + e.VerticalChange);
     Canvas.SetRight(MyCanvas, Canvas.GetLeft(MyThumb) - e.HorizontalChange);
     //Canvas.SetTop(MyCanvas, Canvas.GetTop(MyThumb) + e.VerticalChange);
 }
开发者ID:kbo4sho,项目名称:ZooKeeperWpf,代码行数:7,代码来源:MainWindow.xaml.cs


示例17: HandleBottomRight

        /// <summary>
        /// Handler for resizing from the bottom-right.
        /// </summary>
        private void HandleBottomRight(object sender, DragDeltaEventArgs args)
        {
            FrameworkElement adornedElement = this.AdornedElement as FrameworkElement;
            Thumb hitThumb = sender as Thumb;

            if (adornedElement == null || hitThumb == null) return;
            FrameworkElement parentElement = adornedElement.Parent as FrameworkElement;

            // Ensure that the Width and Height are properly initialized after the resize.
            EnforceSize(adornedElement);

            // Change the size by the amount the user drags the mouse, as long as it's larger 
            // than the width or height of an adorner, respectively.
            adornedElement.Width = Math.Max(adornedElement.Width + args.HorizontalChange, hitThumb.DesiredSize.Width);
            adornedElement.Height = Math.Max(args.VerticalChange + adornedElement.Height, hitThumb.DesiredSize.Height);

            if (adornedElement.Width > parentElement.Width)
            {
                parentElement.Width = adornedElement.Width;
            }

            if (adornedElement.Height > parentElement.Height)
            {
                parentElement.Height = adornedElement.Height;
            }
        }
开发者ID:dbremner,项目名称:ScreenToGif,代码行数:29,代码来源:ResizingAdorner.cs


示例18: MoveThumb_DragDelta

        private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            if (this.designerItem != null && this.designerCanvas != null && this.designerItem.IsSelected)
            {
                double minLeft = double.MaxValue;
                double minTop = double.MaxValue;

                foreach (DesignerItem item in this.designerCanvas.SelectedItems)
                {
                    minLeft = Math.Min(Canvas.GetLeft(item), minLeft);
                    minTop = Math.Min(Canvas.GetTop(item), minTop);
                }

                double deltaHorizontal = Math.Max(-minLeft, e.HorizontalChange);
                double deltaVertical = Math.Max(-minTop, e.VerticalChange);

                foreach (DesignerItem item in this.designerCanvas.SelectedItems)
                {
                    Canvas.SetLeft(item, Math.Min(Canvas.GetLeft(item) + deltaHorizontal, designerCanvas.ActualWidth - item.Width));
                    Canvas.SetTop(item, Math.Min(Canvas.GetTop(item) + deltaVertical, designerCanvas.ActualHeight - item.Height));

                    if (item.PropertyWindow != null)
                        item.PropertyWindow.Moved();
                    else if (item.Model != null)
                        item.Model.Moved();
                }

                this.designerCanvas.InvalidateMeasure();
                e.Handled = true;
            }
        }
开发者ID:CrimsonChris,项目名称:Half-Caked,代码行数:31,代码来源:MoveThumb.cs


示例19: ResizeThumb_DragDelta

 private void ResizeThumb_DragDelta(Object sender, DragDeltaEventArgs e)
 {
     var designerItem = DataContext as Control;
     if (designerItem != null)
     {
         Double deltaVertical, deltaHorizontal;
         switch (VerticalAlignment)
         {
             case VerticalAlignment.Bottom:
                 deltaVertical = Math.Min(-e.VerticalChange, designerItem.ActualHeight - designerItem.MinHeight);
                 designerItem.Height -= deltaVertical;
                 break;
             case VerticalAlignment.Top:
                 deltaVertical = Math.Min(e.VerticalChange, designerItem.ActualHeight - designerItem.MinHeight);
                 Canvas.SetTop(designerItem, Canvas.GetTop(designerItem) + deltaVertical);
                 designerItem.Height -= deltaVertical;
                 break;
         }
         switch (HorizontalAlignment)
         {
             case HorizontalAlignment.Left:
                 deltaHorizontal = Math.Min(e.HorizontalChange, designerItem.ActualWidth - designerItem.MinWidth);
                 Canvas.SetLeft(designerItem, Canvas.GetLeft(designerItem) + deltaHorizontal);
                 designerItem.Width -= deltaHorizontal;
                 break;
             case HorizontalAlignment.Right:
                 deltaHorizontal = Math.Min(-e.HorizontalChange, designerItem.ActualWidth - designerItem.MinWidth);
                 designerItem.Width -= deltaHorizontal;
                 break;
         }
     }
     e.Handled = true;
 }
开发者ID:r0llup,项目名称:ProjectReport,代码行数:33,代码来源:ResizeThumb.cs


示例20: MoveThumb_DragDelta

 private void MoveThumb_DragDelta(object sender, DragDeltaEventArgs e)
 {
     if (DesignerItem.IsSelected)
     {
         _wasMoved = true;
         Vector shift = new Vector(e.HorizontalChange, e.VerticalChange);
         foreach (DesignerItem designerItem in DesignerCanvas.SelectedItems)
         {
             Rect rect = new Rect(Canvas.GetLeft(designerItem), Canvas.GetTop(designerItem), designerItem.ActualWidth, designerItem.ActualHeight);
             if (rect.Right + shift.X > DesignerCanvas.Width)
                 shift.X = DesignerCanvas.Width - rect.Right;
             if (rect.Left + shift.X < 0)
                 shift.X = -rect.Left;
             if (rect.Bottom + shift.Y > DesignerCanvas.Height)
                 shift.Y = DesignerCanvas.Height - rect.Bottom;
             if (rect.Top + shift.Y < 0)
                 shift.Y = -rect.Top;
         }
         foreach (DesignerItem designerItem in DesignerCanvas.SelectedItems)
         {
             designerItem.Element.Position += shift;
             designerItem.SetLocation();
         }
         DesignerCanvas.InvalidateMeasure();
         e.Handled = true;
         ServiceFactory.SaveService.PlansChanged = true;
     }
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:28,代码来源:MoveThumb.cs



注:本文中的System.Windows.Controls.Primitives.DragDeltaEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Primitives.DragStartedEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Primitives.DragCompletedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap