當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。