// Methods internal C1DragStartingEventArgs(C1DragHelper helper, RoutedEventArgs originalArgs, C1PointerDeviceType pointerType, C1DragHelperMode mode, bool captureElementOnPointerPressed, double initialThreshold) : base(helper, originalArgs, pointerType) { Mode = mode; CaptureElementOnPointerPressed = captureElementOnPointerPressed; InitialThreshold = initialThreshold; }
internal C1DragStartingEventArgs(C1DragHelper helper, RoutedEventArgs originalArgs, C1PointerDeviceType pointerType, C1DragHelperMode mode, bool captureElementOnPointerPressed, double initialThreshold) : base(helper, originalArgs, pointerType) { Mode = mode; CaptureElementOnPointerPressed = captureElementOnPointerPressed; InitialThreshold = initialThreshold; }
public C1DragHelper(UIElement element, C1DragHelperMode mode = C1DragHelperMode.TranslateXY, double initialThreshold = 1.0, bool captureElementOnPointerPressed = true, bool handledEventsToo = false, bool useManipulationEvents = false, bool useRightButton = false) { _element = element; _mode = mode; _initialThreshold = initialThreshold; _handledEventsToo = handledEventsToo; _captureElementOnMouseDown = captureElementOnPointerPressed; _listenManipulationEvents = true; _listenPointerEvents = !useManipulationEvents; _useRightButton = useRightButton; InitializeDrag(); }
bool RaiseDragStarting(RoutedEventArgs e) { C1DragStartingEventArgs args = new C1DragStartingEventArgs(this, e, _pointerType, _mode, _captureElementOnMouseDown, _initialThreshold); if (DragStarting != null) { DragStarting(this, args); } _actualMode = args.Mode; _actualCaptureElementOnMouseDown = (args.InitialThreshold == 0.0) || args.CaptureElementOnPointerPressed; _actualInitialThreshold = args.InitialThreshold; return(!args.Cancel); }
public C1DragHelper(UIElement element, C1DragHelperMode mode = C1DragHelperMode.TranslateXY, double initialThreshold = 1, bool captureElementOnPointerPressed = true, bool handledEventsToo = false, bool useManipulationEvents = false, bool useRightButton = false) { _element = element; _mode = mode; _initialThreshold = initialThreshold; _handledEventsToo = handledEventsToo; _captureElementOnMouseDown = captureElementOnPointerPressed; _listenManipulationEvents = true; _listenPointerEvents = true; _useRightButton = useRightButton; InitializeDrag(); }
public static bool TranslateY(this C1DragHelperMode mode) { return(((byte)(mode & C1DragHelperMode.TranslateY)) == 2); }
public static bool TranslateRailY(this C1DragHelperMode mode) { return(((byte)(mode & C1DragHelperMode.TranslateRailY)) == 0x10); }
// Methods public static bool IsInertial(this C1DragHelperMode mode) { return(((byte)(mode & C1DragHelperMode.Inertia)) == 4); }
private bool RaiseDragStarting(RoutedEventArgs e) { var c1DragStartingEventArg = new C1DragStartingEventArgs(this, e, _pointerType, _mode, _captureElementOnMouseDown, _initialThreshold); if (DragStarting != null) { DragStarting(_element, c1DragStartingEventArg); } _actualMode = c1DragStartingEventArg.Mode; _actualCaptureElementOnMouseDown = (c1DragStartingEventArg.InitialThreshold == 0 ? true : c1DragStartingEventArg.CaptureElementOnPointerPressed); _actualInitialThreshold = c1DragStartingEventArg.InitialThreshold; return !c1DragStartingEventArg.Cancel; }