On Pointer Pressed(PointerRoutedEventArgs) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called before the PointerPressed event occurs.
Equivalent WinUI method: Microsoft.UI.Xaml.Controls.Control.OnPointerPressed.
protected: virtual void OnPointerPressed(PointerRoutedEventArgs ^ e) = OnPointerPressed;
void OnPointerPressed(PointerRoutedEventArgs const& e);
protected virtual void OnPointerPressed(PointerRoutedEventArgs e);
Protected Overridable Sub OnPointerPressed (e As PointerRoutedEventArgs)
Event data for the event.
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.