本文整理汇总了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();
}
}
示例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);
}
示例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);
}
示例4: OnMouseEnter
/// <inheritdoc/>
protected override void OnMouseEnter(MouseDevice device, ref RoutedEventData data)
{
if (HighlightOnMouseOver)
{
HighlightOpacity = 1.0;
}
base.OnMouseEnter(device, ref data);
}
示例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);
}
示例6: OnGenericInteraction
/// <inheritdoc/>
protected override void OnGenericInteraction(UltravioletResource device, ref RoutedEventData data)
{
if (!data.Handled)
{
Focus();
data.Handled = true;
}
base.OnGenericInteraction(device, ref data);
}
示例7: Activate
/// <inheritdoc/>
void IRoutedEventRaisedNotificationSubscriber.ReceiveRoutedEventRaisedNotification(DependencyObject dobj, RoutedEvent evt, RoutedEventData data)
{
if (!data.Handled || handled)
{
Activate(dobj);
if (setHandled)
{
data.Handled = true;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例14: OnMouseEnter
/// <inheritdoc/>
protected override void OnMouseEnter(MouseDevice device, RoutedEventData data)
{
if (ClickMode == ClickMode.Hover)
{
OnClick();
OnClickByUser();
}
base.OnMouseEnter(device, data);
}
示例15: OnLostMouseCapture
/// <inheritdoc/>
protected override void OnLostMouseCapture(RoutedEventData data)
{
IsPressed = false;
base.OnLostMouseCapture(data);
}