Control.OnPointerPressed(PointerRoutedEventArgs) Control.OnPointerPressed(PointerRoutedEventArgs) Control.OnPointerPressed(PointerRoutedEventArgs) Control.OnPointerPressed(PointerRoutedEventArgs) Method

Definition

Called before the PointerPressed event occurs.

protected : virtual void OnPointerPressed(PointerRoutedEventArgs e)
virtual void OnPointerPressed(PointerRoutedEventArgs e) const;
protected virtual void OnPointerPressed(PointerRoutedEventArgs e)
Protected Overridable Sub OnPointerPressed(e As PointerRoutedEventArgs)

Parameters

e
PointerRoutedEventArgs PointerRoutedEventArgs

Event data for the event.

Remarks

As it's implemented directly on Control, OnPointerPressed has an empty implementation. But each ancestor in a control's hierarchy may have provided an implementation. You won't be able to see this implementation because it's internal native code. In some cases a control will already have existing On* overrides that mark the event Handled. OnPointerPressed happens to be an On* event that several Windows Runtime XAML controls have provided overrides for. For example, ButtonBase has overridden OnPointerPressed to mark the event Handled. What all buttons do instead is to then raise the Click event that represents a higher-level event behavior for that control. That means you won't easily be able to handle UIElement.PointerPressed on a button, but you probably shouldn't be handling it anyways for most scenarios. Just use Click instead.

See also