当前位置: 首页>>代码示例>>C#>>正文


C# Primitives.DragStartedEventArgs类代码示例

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


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

示例1: RotateThumb_DragStarted

        private void RotateThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as Canvas;

                if (this.canvas != null)
                {
                    this.centerPoint = this.designerItem.TranslatePoint(
                        new Point(this.designerItem.Width * this.designerItem.RenderTransformOrigin.X,
                                  this.designerItem.Height * this.designerItem.RenderTransformOrigin.Y),
                                  this.canvas);

                    Point startPoint = Mouse.GetPosition(this.canvas);
                    this.startVector = Point.Subtract(startPoint, this.centerPoint);

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform == null)
                    {
                        this.designerItem.RenderTransform = new RotateTransform(0);
                        this.initialAngle = 0;
                    }
                    else
                    {
                        this.initialAngle = this.rotateTransform.Angle;
                    }
                }
            }
        }
开发者ID:rakuza,项目名称:YBM2012,代码行数:31,代码来源:RotateThumb.cs

示例2: OnThumbDragStarted

        protected override void OnThumbDragStarted(DragStartedEventArgs e)
        {
            if (ThumbDragStarted != null)
                ThumbDragStarted(this, e);

            base.OnThumbDragStarted(e);
        }
开发者ID:cameronws,项目名称:gemini,代码行数:7,代码来源:SliderEx.cs

示例3: RotateThumb_DragStarted

        private void RotateThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            adornedElement = this.AdornedElement as FrameworkElement;
            Thumb hitThumb = sender as Thumb;

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

            if (parentElement != null)
            {
                this.centerPoint = adornedElement.TranslatePoint(
                                      new Point(adornedElement.Width * 0.5,
                                      adornedElement.Height * 0.5),
                                      parentElement);

                Point startPoint = Mouse.GetPosition(parentElement);
                this.startVector = Point.Subtract(startPoint, this.centerPoint);

                this.rotateTransform = adornedElement.RenderTransform as RotateTransform;
                if (this.rotateTransform == null)
                {
                    adornedElement.RenderTransform = new RotateTransform(
                            0, adornedElement.Width * 0.5, adornedElement.Height * 0.5);

                    this.initialAngle = 0;
                }
                else
                {
                    this.initialAngle = this.rotateTransform.Angle;
                }
            }
        }
开发者ID:leminhtu1204,项目名称:Editor,代码行数:32,代码来源:HelperAdorner.cs

示例4: OnThumbDragStarted

 protected override void OnThumbDragStarted(DragStartedEventArgs e)
 {
     if (SliderDragStarted != null)
     {
         SliderDragStarted(this, e);
     }
 }
开发者ID:JLignell,项目名称:Jokify,代码行数:7,代码来源:SeekSlider.cs

示例5: ResizeThumb_DragStarted

        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = this.DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as ContentPresenter;

                if (this.canvas != null)
                {
                    this.transformOrigin = this.designerItem.RenderTransformOrigin;

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform != null)
                    {
                        this.angle = this.rotateTransform.Angle * Math.PI / 180.0;
                    }
                    else
                    {
                        this.angle = 0.0d;
                    }

                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                    if (adornerLayer != null)
                    {
                        this.adorner = new SizeAdorner(this.designerItem);
                        adornerLayer.Add(this.adorner);
                    }
                }
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:31,代码来源:ResizeThumb.cs

示例6: DragablzDragStartedEventArgs

        public DragablzDragStartedEventArgs(DragablzItem dragablzItem, DragStartedEventArgs dragStartedEventArgs)
            : base(dragablzItem)
        {
            if (dragStartedEventArgs == null) throw new ArgumentNullException("dragStartedEventArgs");

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

示例7: OnThumbDragStarted

 /// <summary>
 /// The on thumb drag started.
 /// </summary>
 /// <param name="e">
 /// The e.
 /// </param>
 protected override void OnThumbDragStarted(DragStartedEventArgs e)
 {
     base.OnThumbDragStarted(e);
     var editableObject = this.DataContext as IEditableObject;
     if (editableObject != null)
     {
         editableObject.BeginEdit();
     }
 }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:15,代码来源:SliderEx.cs

示例8: MoveThumb_DragStarted

        private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = DataContext as DesignerItem;

            if (this.designerItem != null)
            {
                this.designerCanvas = VisualTreeHelper.GetParent(this.designerItem) as DesignerCanvas;
            }
        }
开发者ID:CrimsonChris,项目名称:Half-Caked,代码行数:9,代码来源:MoveThumb.cs

示例9: MoveThumb_DragStarted

        private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:9,代码来源:MoveThumb.cs

示例10: MoveThumb_DragStarted

        private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.element = DataContext as BaseObject;

            if (this.element != null)
            {
                this.canvasWorkspace = VisualTreeHelper.GetParent(this.element) as CanvasWorkspace;
            }
        }
开发者ID:AaronRevilla,项目名称:TT_2012b-049_ComputerGraphics,代码行数:9,代码来源:MoveThumb.cs

示例11: Thumb_DragStarted

        // called when thumb drag started (window resize started)
        void Thumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            WindowThumb thumb = (WindowThumb)sender;

            // store settings of the window, will be used to resize and move the window
            _mouseStartPosition = PointToScreen(Mouse.GetPosition(_window));
            _windowStartPosition = new Point(_window.Left, _window.Top);
            _windowStartSize = new Size(_window.Width, _window.Height);
        }
开发者ID:IAmYourBrother,项目名称:ProjectACE2.0,代码行数:10,代码来源:ResizingAdorner.cs

示例12: DragStartedExecute

        private void DragStartedExecute(DragStartedEventArgs e)
        {
            var thumb = e.OriginalSource as Thumb;
            if (thumb == null)
                return;

            ResizedVisual = thumb.DataContext as ISizeableVisualViewModel;
            DragStartX = e.HorizontalOffset;
            DragStartY = e.VerticalOffset;
        }
开发者ID:WombatPatryk,项目名称:Data2VisualizationBuilder,代码行数:10,代码来源:EditablePointDragManager.cs

示例13: NowPlayingElapsedSlider_DragStarted

 private void NowPlayingElapsedSlider_DragStarted(object sender, DragStartedEventArgs e)
 {
     try
     {
         playbackController.BeginSeek();
     }
     catch (Exception ex)
     {
         log.Error("PlaybackView.NowPlayingElapsedSlider_DragStarted", ex);
     }
 }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:11,代码来源:PlaybackView.xaml.cs

示例14: OnMouseDown

        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            if (e.ChangedButton == Input.MouseButton.Left)
            {
                e.MouseDevice.Capture(this);
                dragStartPosition = e.AbsolutePosition;

                IsDragging = true;

                DragStartedEventArgs dragStartedEventArgs = new DragStartedEventArgs(DragStartedEvent, this);
                RaiseEvent(dragStartedEventArgs);

                e.Handled = dragStartedEventArgs.Handled;
            }
        }
开发者ID:highzion,项目名称:Granular,代码行数:15,代码来源:Thumb.cs

示例15: DragThumb_DragStarted

        /// <summary>
        /// Dragging has started, see if VM is IDiagramLinkViewModel and notify of moving start.
        /// </summary>
        void DragThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            diagramDesigner = DiagramHelper.GetDiagramDesigner(this);
            diagramDesignerVM = diagramDesigner.DataContext as IDiagramViewModel;

            selectedItem = null;
            selectedItemVM = null;

            edgePointVM = this.DataContext as IEdgePointViewModel;

            List<ISelectable> selection = diagramDesigner.SelectionService.CurrentSelection;
            if (selection.Count == 1)
            {
                foreach (ISelectable item in selection)
                {
                    if (item is DiagramDesignerItem)
                        if ((item as DiagramDesignerItem).IsDiagramLink)
                        {
                            selectedItem = item as DiagramDesignerItem;
                        }
                }

                // create control to display on the drag adorner
                dragCanvas = new Canvas();
                IDiagramLinkViewModel designerItem = selectedItem.DataContext as IDiagramLinkViewModel;
                selectedItemVM = designerItem;

                AddLinkAnchorAndShape(new PointD(designerItem.StartEdgePoint.X, designerItem.StartEdgePoint.Y),
                    new PointD(designerItem.EndEdgePoint.X, designerItem.EndEdgePoint.Y));

                // create drag adorner 
                if (diagramDesigner != null && selectedItemVM != null && selectedItem != null && edgePointVM != null)
                {
                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagramDesigner);
                    if (adornerLayer != null)
                    {
                        this.dragAdorner = new DragAdorner(diagramDesigner, dragCanvas, false, 1.0);
                        if (this.dragAdorner != null)
                        {
                            adornerLayer.Add(this.dragAdorner);
                            e.Handled = true;
                        }
                    }
                }
            }
            e.Handled = false;
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:50,代码来源:DiagramDesignerLinkDragThumb.cs


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