当前位置: 首页>>代码示例>>C#>>正文


C# RoutedEventData类代码示例

本文整理汇总了C#中RoutedEventData的典型用法代码示例。如果您正苦于以下问题:C# RoutedEventData类的具体用法?C# RoutedEventData怎么用?C# RoutedEventData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RoutedEventData类属于命名空间,在下文中一共展示了RoutedEventData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandlePreviewMouseDown

 /// <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();
     }
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:10,代码来源:SliderBase.cs

示例2: OnGotKeyboardFocus

 /// <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);
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:9,代码来源:NumericUpDown.cs

示例3: OnPreviewGotKeyboardFocus

 /// <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);
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:9,代码来源:TabItem.cs

示例4: OnMouseEnter

 /// <inheritdoc/>
 protected override void OnMouseEnter(MouseDevice device, ref RoutedEventData data)
 {
     if (HighlightOnMouseOver)
     {
         HighlightOpacity = 1.0;
     }
     base.OnMouseEnter(device, ref data);
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:9,代码来源:ListBoxItem.cs

示例5: OnLostKeyboardFocus

 /// <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);
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:10,代码来源:NumericUpDown.cs

示例6: OnGenericInteraction

 /// <inheritdoc/>
 protected override void OnGenericInteraction(UltravioletResource device, ref RoutedEventData data)
 {
     if (!data.Handled)
     {
         Focus();
         data.Handled = true;
     }
     base.OnGenericInteraction(device, ref data);
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:10,代码来源:TabItem.cs

示例7: Activate

        /// <inheritdoc/>
        void IRoutedEventRaisedNotificationSubscriber.ReceiveRoutedEventRaisedNotification(DependencyObject dobj, RoutedEvent evt, RoutedEventData data)
        {
            if (!data.Handled || handled)
            {
                Activate(dobj);

                if (setHandled)
                {
                    data.Handled = true;
                }
            }
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:13,代码来源:UvssEventTrigger.cs

示例8: OnGenericInteraction

 /// <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);
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:14,代码来源:ComboBoxItem.cs

示例9: OnKeyDown

        /// <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);
        }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:18,代码来源:HSlider.cs

示例10: OnGamePadButtonDown

        /// <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);
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:20,代码来源:VSlider.cs

示例11: OnGamePadAxisDown

        /// <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);
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:21,代码来源:VSlider.cs

示例12: OnMouseUp

 /// <inheritdoc/>
 protected override void OnMouseUp(MouseDevice device, MouseButton button, RoutedEventData data)
 {
     if (button == MouseButton.Left)
     {
         HandleReleased();
         data.Handled = true;
     }
     base.OnMouseUp(device, button, data);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:10,代码来源:ButtonBase.cs

示例13: OnMouseMove

 /// <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);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:13,代码来源:ButtonBase.cs

示例14: OnMouseEnter

 /// <inheritdoc/>
 protected override void OnMouseEnter(MouseDevice device, RoutedEventData data)
 {
     if (ClickMode == ClickMode.Hover)
     {
         OnClick();
         OnClickByUser();
     }
     base.OnMouseEnter(device, data);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:10,代码来源:ButtonBase.cs

示例15: OnLostMouseCapture

 /// <inheritdoc/>
 protected override void OnLostMouseCapture(RoutedEventData data)
 {
     IsPressed = false;
     base.OnLostMouseCapture(data);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:6,代码来源:ButtonBase.cs


注:本文中的RoutedEventData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。