本文整理汇总了C#中System.Windows.Controls.Primitives.DragStartedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DragStartedEventArgs类的具体用法?C# DragStartedEventArgs怎么用?C# DragStartedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DragStartedEventArgs类属于System.Windows.Controls.Primitives命名空间,在下文中一共展示了DragStartedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ResizeThumb_DragStarted
private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
{
this.designerItem = DataContext as ContentControl;
if (this.designerItem != null)
{
this.transformOrigin = this.designerItem.RenderTransformOrigin;
RotateTransform rotateTransform = this.designerItem.RenderTransform as RotateTransform;
if (rotateTransform != null)
{
this.angle = rotateTransform.Angle * Math.PI / 180.0;
}
else
{
this.angle = 0;
}
}
}
开发者ID:jgkim999,项目名称:WpfExample,代码行数:19,代码来源:ResizeThumb.cs
示例17: OnDragStarted
protected override void OnDragStarted(object sender, DragStartedEventArgs e)
{
if (Target != null)
{
var canvas = VisualTreeHelper.GetParent(Target) as MaskCanvas;
if (canvas != null)
{
transformOrigin = Target.RenderTransformOrigin;
rotateTransform = Target.GetRenderTransform<RotateTransform>();
if (rotateTransform != null)
{
angle = rotateTransform.Angle * Math.PI / 180;
}
else
{
angle = 0.0;
}
}
}
}
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:21,代码来源:ResizeThumb.cs
示例18: startDrag
/// <summary>
/// Setzt designerCanvas und workflowItemViewModel und stößt lock des aktuellen WorkflowIteman.
/// Wird beim Start des Drags aufgerufen.
/// </summary>
/// <param name="sender">MoveThumb</param>
/// <param name="e">Eventspezifische Infos</param>
private void startDrag(object sender, DragStartedEventArgs e)
{
// hole ContentControl, das derzeit bewegt wird
Control designerItem = (Control)DataContext;
if (designerItem != null)
{
// hole Item von aktuell bewegtem ContentControl
workflowItemViewModel = (WorkflowItemViewModel)designerItem.DataContext;
// merke Koordinaten zu Beginn des Drags
startLeft = workflowItemViewModel.Left;
startTop = workflowItemViewModel.Top;
// Lock workflowItem - falls Item nicht gesperrt werden kann -> designerCanvas = null
try
{
workflowItemViewModel.LockDrag();
// finde DesignerCanvas, damit Größenberechnung neu angestoßen werden kann
DependencyObject parent = VisualTreeHelper.GetParent(designerItem);
while (parent != null && !(parent is DesignerCanvas))
{
parent = VisualTreeHelper.GetParent(parent);
}
if (parent is DesignerCanvas)
{
designerCanvas = (DesignerCanvas)parent;
}
}
catch (Exception)
{
WorkflowEditorDesignerCanvasErrorViewModel.Instance.Error = "Das Item konnte nicht gesperrt werden. Bitte noch einmal versuchen.";
}
}
}
开发者ID:martinjuhasz,项目名称:Softwaretechnik,代码行数:42,代码来源:MoveThumb.cs
示例19: ProgressSlider_OnDragStarted
private void ProgressSlider_OnDragStarted(object sender, DragStartedEventArgs e)
{
viewModel.OnStartDrag();
}
开发者ID:FezZHD,项目名称:megaPlayer,代码行数:4,代码来源:MainWindow.xaml.cs
示例20: MoveThumb_DragStarted
private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
{
_wasMoved = false;
DesignerCanvas.BeginChange();
}
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:5,代码来源:MoveThumb.cs
注:本文中的System.Windows.Controls.Primitives.DragStartedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论