コード例 #1
0
ファイル: SliderBase.cs プロジェクト: prshreshtha/ultraviolet
 /// <summary>
 /// Handles the <see cref="Mouse.PreviewMouseDownEvent"/>.
 /// </summary>
 private static void HandlePreviewMouseDown(DependencyObject element, MouseDevice device, MouseButton button, ref RoutedEventData data)
 {
     if (button == MouseButton.Left)
     {
         ((SliderBase)element).Focus();
     }
 }
コード例 #2
0
 /// <inheritdoc/>
 protected override void OnMouseEnter(MouseDevice device, ref RoutedEventData data)
 {
     if (HighlightOnMouseOver)
     {
         HighlightOpacity = 1.0;
     }
     base.OnMouseEnter(device, ref data);
 }
コード例 #3
0
ファイル: TabItem.cs プロジェクト: prshreshtha/ultraviolet
 /// <inheritdoc/>
 protected override void OnPreviewGotKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
 {
     if (!data.Handled && newFocus == this)
     {
         Select();
     }
     base.OnPreviewGotKeyboardFocus(device, oldFocus, newFocus, ref data);
 }
コード例 #4
0
 /// <inheritdoc/>
 protected override void OnGotKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
 {
     if (PART_Input != null)
     {
         PART_Input.Focus();
     }
     base.OnGotKeyboardFocus(device, oldFocus, newFocus, ref data);
 }
コード例 #5
0
ファイル: TabItem.cs プロジェクト: prshreshtha/ultraviolet
 /// <inheritdoc/>
 protected override void OnGenericInteraction(UltravioletResource device, ref RoutedEventData data)
 {
     if (!data.Handled)
     {
         Focus();
         data.Handled = true;
     }
     base.OnGenericInteraction(device, ref data);
 }
コード例 #6
0
 /// <inheritdoc/>
 protected override void OnLostKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
 {
     if (PART_Input != null)
     {
         PART_Input.InvalidateDisplayCache(TextBox.TextProperty);
         PART_Input.CaretIndex = 0;
     }
     base.OnLostKeyboardFocus(device, oldFocus, newFocus, ref data);
 }
コード例 #7
0
        /// <inheritdoc/>
        void IRoutedEventRaisedNotificationSubscriber.ReceiveRoutedEventRaisedNotification(DependencyObject dobj, RoutedEvent evt, RoutedEventData data)
        {
            if (!data.Handled || handled)
            {
                Activate(dobj);

                if (setHandled)
                {
                    data.Handled = true;
                }
            }
        }
コード例 #8
0
 /// <inheritdoc/>
 protected override void OnGenericInteraction(UltravioletResource device, ref RoutedEventData data)
 {
     if (!data.Handled)
     {
         var comboBox = ItemsControl.ItemsControlFromItemContainer(this) as ComboBox;
         if (comboBox != null)
         {
             comboBox.HandleItemClicked(this);
         }
         data.Handled = true;
     }
     base.OnGenericInteraction(device, ref data);
 }
コード例 #9
0
ファイル: HSlider.cs プロジェクト: prshreshtha/ultraviolet
        /// <inheritdoc/>
        protected override void OnKeyDown(KeyboardDevice device, Key key, ModifierKeys modifiers, ref RoutedEventData data)
        {
            switch (key)
            {
                case Key.Left:
                    DecreaseSmall();
                    data.Handled = true;
                    break;

                case Key.Right:
                    IncreaseSmall();
                    data.Handled = true;
                    break;
            }

            base.OnKeyDown(device, key, modifiers, ref data);
        }
コード例 #10
0
ファイル: VSlider.cs プロジェクト: RUSshy/ultraviolet
        /// <inheritdoc/>
        protected override void OnGamePadButtonDown(GamePadDevice device, GamePadButton button, Boolean repeat, RoutedEventData data)
        {
            if (!GamePad.UseAxisForDirectionalNavigation)
            {
                switch (button)
                {
                    case GamePadButton.DPadUp:
                        DecreaseSmall();
                        data.Handled = true;
                        break;

                    case GamePadButton.DPadDown:
                        IncreaseSmall();
                        data.Handled = true;
                        break;
                }
            }
            base.OnGamePadButtonDown(device, button, repeat, data);
        }
コード例 #11
0
ファイル: VSlider.cs プロジェクト: RUSshy/ultraviolet
        /// <inheritdoc/>
        protected override void OnGamePadAxisDown(GamePadDevice device, GamePadAxis axis, Single value, Boolean repeat, RoutedEventData data)
        {
            if (GamePad.UseAxisForDirectionalNavigation)
            {
                var direction = device.GetJoystickDirectionFromAxis(axis);
                switch (direction)
                {
                    case GamePadJoystickDirection.Up:
                        DecreaseSmall();
                        data.Handled = true;
                        break;

                    case GamePadJoystickDirection.Down:
                        IncreaseSmall();
                        data.Handled = true;
                        break;
                }
            }
            base.OnGamePadAxisDown(device, axis, value, repeat, data);
        }
コード例 #12
0
        /// <summary>
        /// Handles the <see cref="Mouse.PreviewMouseDownEvent"/>.
        /// </summary>
        private static void HandlePreviewMouseDown(DependencyObject element, MouseDevice device, MouseButton button, RoutedEventData data)
        {
            var slider = element as OrientedSlider;

            if (slider == null)
            {
                return;
            }

            if (button == MouseButton.Left)
            {
                slider.Focus();
            }
        }
コード例 #13
0
        /// <inheritdoc/>
        protected override void OnLostTouchCapture(TouchDevice device, Int64 id, RoutedEventData data)
        {
            HandleCursorUp(id);

            base.OnLostTouchCapture(device, id, data);
        }
コード例 #14
0
        /// <inheritdoc/>
        protected override void OnMouseDoubleClick(MouseDevice device, MouseButton button, ref RoutedEventData data)
        {
            if (PART_Editor != null && IsMouseWithinEditor())
            {
                PART_Editor.HandleMouseDoubleClick(device, button, ref data);
            }

            base.OnMouseDoubleClick(device, button, ref data);
        }
コード例 #15
0
        /// <summary>
        /// Occurs when the user completes a thumb drag operation.
        /// </summary>
        private static void HandleThumbDragCompleted(DependencyObject element, Double hchange, Double vchange, RoutedEventData data)
        {
            var slider = (OrientedSlider)element;

            slider.OnThumbDragCompleted(hchange, vchange, data);
        }
コード例 #16
0
 /// <summary>
 /// Occurs when the user finishes dragging the slider's thumb button.
 /// </summary>
 /// <param name="hchange">The total distance that the thumb moved horizontally.</param>
 /// <param name="vchange">The total distance that the thumb moved vertically.</param>
 /// <param name="data">The routed event metadata for this event invocation.</param>
 protected virtual void OnThumbDragCompleted(Double hchange, Double vchange, RoutedEventData data)
 {
 }
コード例 #17
0
        /// <inheritdoc/>
        protected override void OnLostKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
        {
            Ultraviolet.GetInput().HideSoftwareKeyboard();

            if (PART_Editor != null)
            {
                PART_Editor.HandleLostKeyboardFocus();
            }

            UpdateIsSelectionActive();

            base.OnLostKeyboardFocus(device, oldFocus, newFocus, ref data);
        }
コード例 #18
0
        /// <summary>
        /// Handles the <see cref="Keyboard.PreviewKeyDownEvent"/> routed event.
        /// </summary>
        private static void HandlePreviewKeyDown(DependencyObject element, KeyboardDevice device, Key key, ModifierKeys modifiers, ref RoutedEventData data)
        {
            var numericUpDown = (NumericUpDown)element;

            if (numericUpDown.PART_Input == data.OriginalSource)
            {
                switch (key)
                {
                case Key.Up:
                    numericUpDown.IncreaseSmall();
                    data.Handled = true;
                    break;

                case Key.Down:
                    numericUpDown.DecreaseSmall();
                    data.Handled = true;
                    break;
                }
            }
        }
コード例 #19
0
ファイル: Mouse.cs プロジェクト: RUSshy/ultraviolet
 /// <summary>
 /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Mouse.LostMouseCapture"/>
 /// attached event for the specified element.
 /// </summary>
 internal static void RaiseLostMouseCapture(DependencyObject element, RoutedEventData data)
 {
     var evt = EventManager.GetInvocationDelegate<UpfRoutedEventHandler>(LostMouseCaptureEvent);
     evt?.Invoke(element, data);
 }
コード例 #20
0
 /// <summary>
 /// Called when the ButtonDown component is clicked.
 /// </summary>
 private void Decrement(DependencyObject element, ref RoutedEventData data)
 {
     DecreaseSmall();
 }
コード例 #21
0
        /// <summary>
        /// Handles the <see cref="Mouse.PreviewMouseWheelEvent"/> routed event.
        /// </summary>
        private static void HandlePreviewMouseWheel(DependencyObject element, MouseDevice device, Double x, Double y, ref RoutedEventData data)
        {
            var numericUpDown = (NumericUpDown)element;

            if (numericUpDown.PART_Input.IsKeyboardFocused)
            {
                numericUpDown.Value += y;
            }
        }
コード例 #22
0
        /// <inheritdoc/>
        protected override void OnGamePadButtonDown(GamePadDevice device, GamePadButton button, Boolean repeat, ref RoutedEventData data)
        {
            if (!GamePad.UseAxisForDirectionalNavigation)
            {
                switch (button)
                {
                case GamePadButton.DPadUp:
                    IncreaseSmall();
                    data.Handled = true;
                    break;

                case GamePadButton.DPadDown:
                    DecreaseSmall();
                    data.Handled = true;
                    break;
                }
            }
            base.OnGamePadButtonDown(device, button, repeat, ref data);
        }
コード例 #23
0
        /// <inheritdoc/>
        protected override void OnTouchMove(TouchDevice device, Int64 id, Double x, Double y, Double dx, Double dy, Single pressure, RoutedEventData data)
        {
            if (IsDragging)
            {
                HandleCursorMove(0);

                data.Handled = true;
            }
            base.OnTouchMove(device, id, x, y, dx, dy, pressure, data);
        }
コード例 #24
0
        /// <inheritdoc/>
        protected override void OnTouchDown(TouchDevice device, Int64 id, Double x, Double y, Single pressure, RoutedEventData data)
        {
            Focus();
            CaptureTouch(id);

            HandleCursorDown(id);

            data.Handled = true;

            base.OnTouchDown(device, id, x, y, pressure, data);
        }
コード例 #25
0
ファイル: GamePad.cs プロジェクト: prshreshtha/ultraviolet
 /// <summary>
 /// Raises the PreviewAxisUp attached event for the specified element.
 /// </summary>
 internal static void RaisePreviewAxisUp(DependencyObject element, GamePadDevice device, GamePadAxis axis, ref RoutedEventData data)
 {
     var temp = EventManager.GetInvocationDelegate<UpfGamePadAxisUpEventHandler>(PreviewAxisUpEvent);
     if (temp != null)
     {
         temp(element, device, axis, ref data);
     }
 }
コード例 #26
0
        /// <summary>
        /// Handles text entry validation for the updown's text editor.
        /// </summary>
        private static void HandleTextEntryValidation(DependencyObject element, StringSegment text, Int32 offset, Char character, ref Boolean valid, ref RoutedEventData data)
        {
            var numericUpDown = (NumericUpDown)element;

            if (numericUpDown.PART_Input != data.OriginalSource)
            {
                return;
            }

            data.Handled = true;

            // Negative sign must be inserted at the beginning of the text.
            // Negative sign is only allowed if Minimum is less than zero.
            if (character == '-')
            {
                if (offset > 0 || numericUpDown.Minimum >= 0)
                {
                    valid = false;
                }

                return;
            }

            // Nothing can be inserted before the negative sign, if there is one.
            var negativeSignPos = text.IndexOf('-');

            if (negativeSignPos >= 0 && offset < 1)
            {
                valid = false;
                return;
            }

            // Decimal separator can only be inserted if we allow decimal points.
            // Decimal separator can only be inserted if it doesn't introduce more than the allowed number of decimals.
            var decimalSeparatorPos = text.IndexOf('.');

            if (character == '.')
            {
                if (decimalSeparatorPos >= 0 || numericUpDown.DecimalPlaces == 0)
                {
                    valid = false;
                    return;
                }

                var decimalsIntroduced = text.Length - offset;
                if (decimalsIntroduced > numericUpDown.DecimalPlaces)
                {
                    valid = false;
                }

                return;
            }

            // Non-digit characters cannot be inserted.
            if (!Char.IsDigit(character))
            {
                valid = false;
                return;
            }

            // Post-decimal digits can only be inserted if we have fewer than DecimalPlaces digits there already.
            var decimalCount = (decimalSeparatorPos < 0) ? 0 : text.Length - (decimalSeparatorPos + 1);

            if (decimalSeparatorPos >= 0 && decimalSeparatorPos < offset && decimalCount >= numericUpDown.DecimalPlaces)
            {
                valid = false;
                return;
            }
        }
コード例 #27
0
ファイル: GamePad.cs プロジェクト: prshreshtha/ultraviolet
 /// <summary>
 /// Raises the ButtonUp attached event for the specified element.
 /// </summary>
 internal static void RaiseButtonUp(DependencyObject element, GamePadDevice device, GamePadButton button, ref RoutedEventData data)
 {
     var temp = EventManager.GetInvocationDelegate<UpfGamePadButtonUpEventHandler>(ButtonUpEvent);
     if (temp != null)
     {
         temp(element, device, button, ref data);
     }
 }
コード例 #28
0
        /// <inheritdoc/>
        protected override void OnLostMouseCapture(RoutedEventData data)
        {
            HandleCursorUp(0);

            base.OnLostMouseCapture(data);
        }
コード例 #29
0
ファイル: Mouse.cs プロジェクト: RUSshy/ultraviolet
 /// <summary>
 /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Mouse.PreviewMouseUp"/>
 /// attached event for the specified element.
 /// </summary>
 internal static void RaisePreviewMouseUp(DependencyObject element, MouseDevice device, MouseButton button, RoutedEventData data)
 {
     var evt = EventManager.GetInvocationDelegate<UpfMouseButtonEventHandler>(PreviewMouseUpEvent);
     evt?.Invoke(element, device, button, data);
 }
コード例 #30
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnGamePadButtonUp(GamePadDevice device, GamePadButton button, RoutedEventData data)
 {
     if (GamePad.ConfirmButton == button)
     {
         HandleReleased(false);
         data.Handled = true;
     }
     base.OnGamePadButtonUp(device, button, data);
 }
コード例 #31
0
        /// <inheritdoc/>
        protected override void OnKeyDown(KeyboardDevice device, Key key, ModifierKeys modifiers, ref RoutedEventData data)
        {
            if (PART_Editor != null)
            {
                PART_Editor.HandleKeyDown(device, key, modifiers, ref data);
            }

            base.OnKeyDown(device, key, modifiers, ref data);
        }
コード例 #32
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnKeyUp(KeyboardDevice device, Key key, RoutedEventData data)
 {
     if (key == Key.Return || key == Key.Space)
     {
         HandleReleased(false);
         data.Handled = true;
     }
     base.OnKeyUp(device, key, data);
 }
コード例 #33
0
        /// <inheritdoc/>
        protected override void OnMouseMove(MouseDevice device, Double x, Double y, Double dx, Double dy, ref RoutedEventData data)
        {
            if (PART_Editor != null)
            {
                PART_Editor.HandleMouseMove(device, ref data);
            }

            data.Handled = true;
            base.OnMouseMove(device, x, y, dx, dy, ref data);
        }
コード例 #34
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnLostMouseCapture(RoutedEventData data)
 {
     IsPressed = false;
     base.OnLostMouseCapture(data);
 }
コード例 #35
0
ファイル: Touch.cs プロジェクト: VoodooLlama/ultraviolet
        /// <summary>
        /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Touch.FingerMotion"/>
        /// attached event for the specified element.
        /// </summary>
        internal static void RaiseFingerMotion(DependencyObject element, TouchDevice device, Int64 fingerID,
                                               Double x, Double y, Double dx, Double dy, Single pressure, ref RoutedEventData data)
        {
            var evt = EventManager.GetInvocationDelegate <UpfTouchMotionEventHandler>(FingerMotionEvent);

            evt?.Invoke(element, device, fingerID, x, y, dx, dy, pressure, ref data);
        }
コード例 #36
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnMouseMove(MouseDevice device, Double x, Double y, Double dx, Double dy, RoutedEventData data)
 {
     if (ClickMode != ClickMode.Hover)
     {
         if (IsMouseCaptured && device.IsButtonDown(MouseButton.Left))
         {
             var position = Mouse.GetPosition(this);
             IsPressed = Bounds.Contains(position);
         }
     }
     base.OnMouseMove(device, x, y, dx, dy, data);
 }
コード例 #37
0
        /// <summary>
        /// Occurs when the user starts a thumb drag operation.
        /// </summary>
        private static void HandleThumbDragStarted(DependencyObject element, Double hoffset, Double voffset, RoutedEventData data)
        {
            var slider = (OrientedSlider)element;

            slider.OnThumbDragStarted(hoffset, voffset, data);
        }
コード例 #38
0
ファイル: ScrollBarBase.cs プロジェクト: RUSshy/ultraviolet
        /// <inheritdoc/>
        protected override void OnFingerMotion(TouchDevice device, Int64 fingerID, Double x, Double y, Double dx, Double dy, Single pressure, RoutedEventData data)
        {
            data.Handled = true;

            base.OnFingerMotion(device, fingerID, x, y, dx, dy, pressure, data);
        }
コード例 #39
0
 /// <inheritdoc/>
 protected override void OnGotKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
 {
     if (PART_Input != null)
     {
         PART_Input.Focus();
     }
     base.OnGotKeyboardFocus(device, oldFocus, newFocus, ref data);
 }
コード例 #40
0
        /// <inheritdoc/>
        protected override void OnMouseMove(MouseDevice device, Double x, Double y, Double dx, Double dy, RoutedEventData data)
        {
            if (IsDragging)
            {
                HandleCursorMove(0);

                data.Handled = true;
            }
            base.OnMouseMove(device, x, y, dx, dy, data);
        }
コード例 #41
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnGamePadButtonDown(GamePadDevice device, GamePadButton button, Boolean repeat, RoutedEventData data)
 {
     if (GamePad.ConfirmButton == button && !repeat)
     {
         HandlePressed();
         data.Handled = true;
     }
     base.OnGamePadButtonDown(device, button, repeat, data);
 }
コード例 #42
0
 /// <inheritdoc/>
 protected override void OnLostKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
 {
     if (PART_Input != null)
     {
         PART_Input.InvalidateDisplayCache(TextBox.TextProperty);
         PART_Input.CaretIndex = 0;
     }
     base.OnLostKeyboardFocus(device, oldFocus, newFocus, ref data);
 }
コード例 #43
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnKeyDown(KeyboardDevice device, Key key, ModifierKeys modifiers, RoutedEventData data)
 {
     if (key == Key.Return || key == Key.Space)
     {
         HandlePressed();
         data.Handled = true;
     }
     base.OnKeyDown(device, key, modifiers, data);
 }
コード例 #44
0
        /// <inheritdoc/>
        protected override void OnGamePadAxisDown(GamePadDevice device, GamePadAxis axis, Single value, Boolean repeat, ref RoutedEventData data)
        {
            if (GamePad.UseAxisForDirectionalNavigation)
            {
                var direction = device.GetJoystickDirectionFromAxis(axis);
                switch (direction)
                {
                case GamePadJoystickDirection.Up:
                    IncreaseSmall();
                    data.Handled = true;
                    break;

                case GamePadJoystickDirection.Down:
                    DecreaseSmall();
                    data.Handled = true;
                    break;
                }
            }

            base.OnGamePadAxisDown(device, axis, value, repeat, ref data);
        }
コード例 #45
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnLostKeyboardFocus(KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, RoutedEventData data)
 {
     if (IsPressed)
     {
         IsPressed = false;
     }
     base.OnLostKeyboardFocus(device, oldFocus, newFocus, data);
 }
コード例 #46
0
        /// <inheritdoc/>
        protected override void OnMouseMove(MouseDevice device, Double x, Double y, Double dx, Double dy, RoutedEventData data)
        {
            LinkUtil.UpdateLinkCursor(textLayoutCommands, this, Mouse.GetPosition(this));

            base.OnMouseMove(device, x, y, dx, dy, data);
        }
コード例 #47
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnMouseEnter(MouseDevice device, RoutedEventData data)
 {
     if (ClickMode == ClickMode.Hover)
     {
         OnClick();
         OnClickByUser();
     }
     base.OnMouseEnter(device, data);
 }
コード例 #48
0
        /// <inheritdoc/>
        protected override void OnMouseLeave(MouseDevice device, RoutedEventData data)
        {
            LinkUtil.UpdateLinkCursor(textLayoutCommands, this, Mouse.GetPosition(this));

            base.OnMouseLeave(device, data);
        }
コード例 #49
0
ファイル: ButtonBase.cs プロジェクト: RUSshy/ultraviolet
 /// <inheritdoc/>
 protected override void OnMouseUp(MouseDevice device, MouseButton button, RoutedEventData data)
 {
     if (button == MouseButton.Left)
     {
         HandleReleased();
         data.Handled = true;
     }
     base.OnMouseUp(device, button, data);
 }
コード例 #50
0
        /// <summary>
        /// Raises the <see cref="P:Ultraviolet.Presentation.Controls.ToolTipService.ToolTipClosing"/>
        /// attached event for the specified element.
        /// </summary>
        internal static void RaiseToolTipClosing(DependencyObject element, RoutedEventData data)
        {
            var evt = EventManager.GetInvocationDelegate <UpfToolTipEventHandler>(ToolTipClosingEvent);

            evt?.Invoke(element, data);
        }
コード例 #51
0
ファイル: VScrollBar.cs プロジェクト: RUSshy/ultraviolet
 /// <summary>
 /// Handles the <see cref="ButtonBase.Click"/> event for LineUpButton.
 /// </summary>
 private void HandleClickLineUp(DependencyObject element, RoutedEventData data)
 {
     DecreaseSmall();
     RaiseScrollEvent(ScrollEventType.SmallDecrement);
 }
コード例 #52
0
ファイル: KeyGesture.cs プロジェクト: hayate891/ultraviolet
 /// <inheritdoc/>
 public override Boolean MatchesKeyDown(KeyboardDevice device, Key key, ModifierKeys modifiers, RoutedEventData data)
 {
     return(key == Key && modifiers.IsEquivalentTo(Modifiers));
 }
コード例 #53
0
ファイル: GamePad.cs プロジェクト: prshreshtha/ultraviolet
 /// <summary>
 /// Raises the AxisDown attached event for the specified element.
 /// </summary>
 internal static void RaiseAxisDown(DependencyObject element, GamePadDevice device, GamePadAxis axis, Single value, Boolean repeat, ref RoutedEventData data)
 {
     var temp = EventManager.GetInvocationDelegate<UpfGamePadAxisDownEventHandler>(AxisDownEvent);
     if (temp != null)
     {
         temp(element, device, axis, value, repeat, ref data);
     }
 }
コード例 #54
0
        /// <summary>
        /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Keyboard.LostKeyboardFocus"/>
        /// attached event for the specified element.
        /// </summary>
        internal static void RaiseLostKeyboardFocus(DependencyObject element, KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, ref RoutedEventData data)
        {
            var evt = EventManager.GetInvocationDelegate <UpfKeyboardFocusChangedEventHandler>(LostKeyboardFocusEvent);

            evt?.Invoke(element, device, oldFocus, newFocus, ref data);
        }
コード例 #55
0
        /// <summary>
        /// Raises the <see cref="PasswordBox.PasswordChangedEvent"/> routed event against the editor's templated parent.
        /// </summary>
        private void RaisePasswordChanged(PasswordBox target)
        {
            var evtDelegate = EventManager.GetInvocationDelegate<UpfRoutedEventHandler>(PasswordBox.PasswordChangedEvent);
            var evtData = new RoutedEventData(target);

            evtDelegate(target, ref evtData);
        }
コード例 #56
0
        /// <summary>
        /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Keyboard.PreviewTextEditing"/>
        /// attached event for the specified element.
        /// </summary>
        internal static void RaisePreviewTextEditing(DependencyObject element, KeyboardDevice device, ref RoutedEventData data)
        {
            var evt = EventManager.GetInvocationDelegate <UpfKeyboardEventHandler>(PreviewTextEditingEvent);

            evt?.Invoke(element, device, ref data);
        }
コード例 #57
0
ファイル: Mouse.cs プロジェクト: RUSshy/ultraviolet
 /// <summary>
 /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Mouse.MouseLeave"/>
 /// attached event for the specified element.
 /// </summary>
 internal static void RaiseMouseLeave(DependencyObject element, MouseDevice device, RoutedEventData data)
 {
     var evt = EventManager.GetInvocationDelegate<UpfMouseEventHandler>(MouseLeaveEvent);
     evt?.Invoke(element, device, data);
 }
コード例 #58
0
        /// <summary>
        /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Keyboard.PreviewKeyDown"/>
        /// attached event for the specified element.
        /// </summary>
        internal static void RaisePreviewKeyDown(DependencyObject element, KeyboardDevice device, Key key, Boolean ctrl, Boolean alt, Boolean shift, Boolean repeat, ref RoutedEventData data)
        {
            var evt = EventManager.GetInvocationDelegate <UpfKeyDownEventHandler>(PreviewKeyDownEvent);

            evt?.Invoke(element, device, key, Modifiers, ref data);
        }
コード例 #59
0
ファイル: Mouse.cs プロジェクト: RUSshy/ultraviolet
 /// <summary>
 /// Raises the <see cref="E:TwistedLogik.Ultraviolet.UI.Presentation.Input.Mouse.PreviewMouseWheel"/>
 /// attached event for the specified element.
 /// </summary>
 internal static void RaisePreviewMouseWheel(DependencyObject element, MouseDevice device, Double x, Double y, RoutedEventData data)
 {
     var evt = EventManager.GetInvocationDelegate<UpfMouseWheelEventHandler>(PreviewMouseWheelEvent);
     evt?.Invoke(element, device, x, y, data);
 }
コード例 #60
0
 /// <summary>
 /// Occurs when the user begins dragging the slider's thumb button.
 /// </summary>
 /// <param name="hoffset">The horizontal offset at which the thumb was clicked, in relative coordinates.</param>
 /// <param name="voffset">The vertical offset at which the thumb was clicked, in relative coordinates.</param>
 /// <param name="data">The routed event metadata for this event invocation.</param>
 protected virtual void OnThumbDragStarted(Double hoffset, Double voffset, RoutedEventData data)
 {
 }