Windows.UI.Xaml.Controls.Primitives.ButtonBase.ClickMode

June 22, 2022 · View on GitHub

-description

Gets or sets a value that indicates when the Click event occurs, in terms of device behavior.

-xaml-syntax

<button ClickMode="clickModeMemberName"/>

-xaml-values

clickModeMemberName
clickModeMemberNameA named constant of the ClickMode enumeration, such as Hover.
## -property-value A value of the enumeration that indicates when the [Click](buttonbase_click.md) event occurs.

-remarks

-examples

The following example shows three buttons that respond to clicks in three different ways based on their ClickMode property value.

  • Hover - When the mouse pointer hovers over the first button, the foreground color of the button changes.
  • Press - When the left mouse button is pressed while over the second button, the foreground color of the button changes.
  • Release - When the mouse button is pressed and released while over the third button, the button resets the foreground color of the other two buttons to their original color.

[!code-xaml1]

[!code-csharp11]

[!code-vb11]

-see-also

Button