Show / Hide Table of Contents

Class MouseDragElementBehavior

Repositions the attached element in response to mouse drag gestures on the element.

Inheritance
System.Object
DependencyObject
Behavior
Behavior<FrameworkElement>
MouseDragElementBehavior
Implements
IAttachedObject
Inherited Members
Behavior<FrameworkElement>.AssociatedObject
Behavior.AssociatedType
Behavior.IAttachedObject.AssociatedObject
Behavior.Attach(DependencyObject)
Behavior.Detach()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Microsoft.Expression.Interactivity.Layout
Assembly: OpenSilver.Expression.Interactions.dll
Syntax
public class MouseDragElementBehavior : Behavior<FrameworkElement>, IDependencyObject, IAttachedObject

Fields

| Improve this Doc View Source

ConstrainToParentBoundsProperty

Dependency property for the ConstrainToParentBounds property. If true, the dragged element will be constrained to stay within the bounds of its parent container.

Declaration
public static readonly DependencyProperty ConstrainToParentBoundsProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

XProperty

Dependency property for the X position of the dragged element, relative to the left of the root element.

Declaration
public static readonly DependencyProperty XProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

YProperty

Dependency property for the Y position of the dragged element, relative to the top of the root element.

Declaration
public static readonly DependencyProperty YProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

ConstrainToParentBounds

Gets or sets a value indicating whether the dragged element is constrained to stay within the bounds of its parent container. This is a dependency property.

Declaration
public bool ConstrainToParentBounds { get; set; }
Property Value
Type Description
System.Boolean

True if the dragged element should be constrained to its parents bounds; otherwise, False.

| Improve this Doc View Source

X

Gets or sets the X position of the dragged element, relative to the left of the root element. This is a dependency property.

Declaration
public double X { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Y

Gets or sets the Y position of the dragged element, relative to the top of the root element. This is a dependency property.

Declaration
public double Y { get; set; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

OnAttached()

Called after the behavior is attached to an AssociatedObject.

Declaration
protected override void OnAttached()
Overrides
Behavior.OnAttached()
Remarks

Override this to hook up functionality to the AssociatedObject.

| Improve this Doc View Source

OnDetaching()

Called when the behavior is getting detached from its AssociatedObject, but before it has actually occurred.

Declaration
protected override void OnDetaching()
Overrides
Behavior.OnDetaching()
Remarks

Override this to unhook functionality from the AssociatedObject.

Events

| Improve this Doc View Source

DragBegun

Occurs when a drag gesture is initiated.

Declaration
public event MouseEventHandler DragBegun
Event Type
Type Description
MouseEventHandler
| Improve this Doc View Source

DragFinished

Occurs when a drag gesture is finished.

Declaration
public event MouseEventHandler DragFinished
Event Type
Type Description
MouseEventHandler
| Improve this Doc View Source

Dragging

Occurs when a drag gesture update is processed.

Declaration
public event MouseEventHandler Dragging
Event Type
Type Description
MouseEventHandler

Implements

IAttachedObject

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
  • Improve this Doc
  • View Source