Class MouseDragElementBehavior
Repositions the attached element in response to mouse drag gestures on the element.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.Expression.Interactivity.Layout
Assembly: OpenSilver.Expression.Interactions.dll
Syntax
public class MouseDragElementBehavior : Behavior<FrameworkElement>, IDependencyObject, IAttachedObject
Fields
| Improve this Doc View SourceConstrainToParentBoundsProperty
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 |
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 |
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 SourceConstrainToParentBounds
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 |
|
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 |
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 SourceOnAttached()
Called after the behavior is attached to an AssociatedObject.
Declaration
protected override void OnAttached()
Overrides
Remarks
Override this to hook up functionality to the AssociatedObject.
OnDetaching()
Called when the behavior is getting detached from its AssociatedObject, but before it has actually occurred.
Declaration
protected override void OnDetaching()
Overrides
Remarks
Override this to unhook functionality from the AssociatedObject.
Events
| Improve this Doc View SourceDragBegun
Occurs when a drag gesture is initiated.
Declaration
public event MouseEventHandler DragBegun
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |
DragFinished
Occurs when a drag gesture is finished.
Declaration
public event MouseEventHandler DragFinished
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |
Dragging
Occurs when a drag gesture update is processed.
Declaration
public event MouseEventHandler Dragging
Event Type
| Type | Description |
|---|---|
| MouseEventHandler |