• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# RoutedEventData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: RaisePreviewMouseUp

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


示例17: RaiseLostMouseCapture

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


示例18: RaiseButtonUp

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


示例19: RaisePreviewAxisUp

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


示例20: OnFingerMotion

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RoutedEventHandler类代码示例发布时间:2022-05-24
下一篇:
C# RoutedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap