Control.OnPointerPressed(PointerRoutedEventArgs) Method

Definition

Called before the PointerPressed event occurs.

protected:
 virtual void OnPointerPressed(PointerRoutedEventArgs ^ e) = OnPointerPressed;
void OnPointerPressed(PointerRoutedEventArgs const& e);
protected virtual void OnPointerPressed(PointerRoutedEventArgs e);
function onPointerPressed(e)
Protected Overridable Sub OnPointerPressed (e As PointerRoutedEventArgs)

Parameters

e
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 OnEvent overrides that mark the event Handled. OnPointerPressed happens to be an OnEvent 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.

Applies to

See also