ButtonBase ButtonBase ButtonBase Class

Definition

Represents the base class for all button controls, such as Button, RepeatButton, and HyperlinkButton.

public : class ButtonBase : ContentControl, IButtonBase
public class ButtonBase : ContentControl, IButtonBase
Public Class ButtonBase Inherits ContentControl Implements IButtonBase
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following example demonstrates handling the Click event and setting the IsEnabled property of a Button, which inherits from ButtonBase.

<StackPanel>   
    <Button Content="Submit" 
            Click="submitButtonClick"/>
    <TextBlock x:Name="textBlock1"/>
</StackPanel>
void submitButtonClick(object sender, RoutedEventArgs e)
{
    textBlock1.Text = "You clicked the Submit button.";
}
Private Sub submitButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.Text = "You clicked the Submit button."
End Sub

Remarks

ButtonBase derived classes

ButtonBase is the parent class for several immediately derived controls that refine specific button behaviors for UI interaction:

Constructors

ButtonBase() ButtonBase() ButtonBase()

Provides base class initialization behavior for ButtonBase derived classes.

protected : ButtonBase()
protected ButtonBase()
Protected Sub New()

Properties

AccessKey AccessKey AccessKey

Inherited from UIElement

AccessKeyProperty AccessKeyProperty AccessKeyProperty

Inherited from UIElement

AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner

Inherited from UIElement

AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty

Inherited from UIElement

ActualHeight ActualHeight ActualHeight

Inherited from FrameworkElement

ActualHeightProperty ActualHeightProperty ActualHeightProperty

Inherited from FrameworkElement

ActualTheme ActualTheme ActualTheme

Inherited from FrameworkElement

ActualThemeProperty ActualThemeProperty ActualThemeProperty

Inherited from FrameworkElement

ActualWidth ActualWidth ActualWidth

Inherited from FrameworkElement

ActualWidthProperty ActualWidthProperty ActualWidthProperty

Inherited from FrameworkElement

AllowDrop AllowDrop AllowDrop

Inherited from UIElement

AllowDropProperty AllowDropProperty AllowDropProperty

Inherited from UIElement

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Inherited from FrameworkElement

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Inherited from FrameworkElement

AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled

Inherited from FrameworkElement

AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty

Inherited from FrameworkElement

Background Background Background

Inherited from Control

BackgroundProperty BackgroundProperty BackgroundProperty

Inherited from Control

BaseUri BaseUri BaseUri

Inherited from FrameworkElement

BorderBrush BorderBrush BorderBrush

Inherited from Control

BorderBrushProperty BorderBrushProperty BorderBrushProperty

Inherited from Control

BorderThickness BorderThickness BorderThickness

Inherited from Control

BorderThicknessProperty BorderThicknessProperty BorderThicknessProperty

Inherited from Control

CacheMode CacheMode CacheMode

Inherited from UIElement

CacheModeProperty CacheModeProperty CacheModeProperty

Inherited from UIElement

CanDrag CanDrag CanDrag

Inherited from UIElement

CanDragProperty CanDragProperty CanDragProperty

Inherited from UIElement

CharacterReceivedEvent CharacterReceivedEvent CharacterReceivedEvent

Inherited from UIElement

CharacterSpacing CharacterSpacing CharacterSpacing

Inherited from Control

CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty

Inherited from Control

ClickMode ClickMode ClickMode

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

public : ClickMode ClickMode { get; set; }
public ClickMode ClickMode { get; set; }
Public ReadWrite Property ClickMode As ClickMode
<button ClickMode="clickModeMemberName"/>



Value
ClickMode ClickMode ClickMode

A value of the enumeration that indicates when the Click event occurs.

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.
<StackPanel x:Name="LayoutRoot" Margin="10">
  <Button x:Name="btn1" Content="Hover to Click"
          Click="OnClick1" ClickMode="Hover"
          Margin="5" Width="150"
          HorizontalAlignment="Left"
          Foreground="Green"/>
  <TextBlock x:Name="text1" Margin="5,8,0,0" />
  
  <Button x:Name="btn2" Content="Press to Click"
          Click="OnClick2" ClickMode="Press"
          Margin="5,5,5,5" Width="150" 
          HorizontalAlignment="Left" 
          Foreground="Blue"/>
  <TextBlock x:Name="text2" Margin="5,8,0,0" />
  
  <Button x:Name="btn3" Content="Reset"
          Click="OnClick3" ClickMode="Release"
          Margin="5,5,5,5" Width="150"
          HorizontalAlignment="Left"/>
  <TextBlock x:Name="text3" Margin="5,8,0,0" />
</StackPanel>
void OnClick1(object sender, RoutedEventArgs e)
{
    btn1.Foreground = new SolidColorBrush(Windows.UI.Colors.Blue);
    text1.Text = "Click event occurs on Hover.";
    text2.Text = "";
    text3.Text = "";
}

void OnClick2(object sender, RoutedEventArgs e)
{
    btn2.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
    text1.Text = "";
    text2.Text = "Click event occurs on Press.";
    text3.Text = "";
}

void OnClick3(object sender, RoutedEventArgs e)
{
    btn1.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
    btn2.Foreground = new SolidColorBrush(Windows.UI.Colors.Blue);
    text1.Text = "";
    text2.Text = "";
    text3.Text = "Click event occurs on Release.";
}
Private Sub OnClick1(ByVal sender As Object, ByVal e As RoutedEventArgs)
    btn1.Foreground = New SolidColorBrush(Windows.UI.Colors.Blue)
    text1.Text = "Click event handled on Hover."
    text2.Text = ""
    text3.Text = ""
End Sub

Private Sub OnClick2(ByVal sender As Object, ByVal e As RoutedEventArgs)
    btn2.Foreground = New SolidColorBrush(Windows.UI.Colors.Green)
    text1.Text = ""
    text2.Text = "Click event handled on Press."
    text3.Text = ""
End Sub

Private Sub OnClick3(ByVal sender As Object, ByVal e As RoutedEventArgs)
    btn1.Foreground = New SolidColorBrush(Windows.UI.Colors.Green)
    btn2.Foreground = New SolidColorBrush(Windows.UI.Colors.Blue)
    text1.Text = ""
    text2.Text = ""
    text3.Text = "Click event handled on Release."
End Sub

ClickModeProperty ClickModeProperty ClickModeProperty

Identifies the ClickMode dependency property.

public : static DependencyProperty ClickModeProperty { get; }
public static DependencyProperty ClickModeProperty { get; }
Public Static ReadOnly Property ClickModeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ClickMode dependency property.

Clip Clip Clip

Inherited from UIElement

ClipProperty ClipProperty ClipProperty

Inherited from UIElement

Command Command Command

Gets or sets the command to invoke when this button is pressed.

public : ICommand Command { get; set; }
public ICommand Command { get; set; }
Public ReadWrite Property Command As ICommand
<button Command="commandReference"/>

Value
ICommand ICommand ICommand

The command to invoke when this button is pressed. The default is null.

Remarks

The ICommand interface comes from a different source depending on whether the data source is implemented in C++ or for Microsoft .NET. C++ implements Windows::UI::Xaml::Input::ICommand. Microsoft .NET implements System.Windows.Input.ICommand. Both interfaces have the same template. Which interface you call from your app code is analogous: use Windows::UI::Xaml::Input::ICommand for C++ code and System.Windows.Input.ICommand for Microsoft .NET code.

CommandParameter CommandParameter CommandParameter

Gets or sets the parameter to pass to the Command property.

public : Platform::Object CommandParameter { get; set; }
public object CommandParameter { get; set; }
Public ReadWrite Property CommandParameter As object
<button>
  <button.CommandParameter>
    object
  </button.CommandParameter>
</button>
Value
Platform::Object object object

The parameter to pass to the Command property. The default is null.

CommandParameterProperty CommandParameterProperty CommandParameterProperty

Identifier for the CommandParameter dependency property.

public : static DependencyProperty CommandParameterProperty { get; }
public static DependencyProperty CommandParameterProperty { get; }
Public Static ReadOnly Property CommandParameterProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the CommandParameter dependency property.

CommandProperty CommandProperty CommandProperty

Identifier for the Command dependency property.

public : static DependencyProperty CommandProperty { get; }
public static DependencyProperty CommandProperty { get; }
Public Static ReadOnly Property CommandProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Command dependency property.

CompositeMode CompositeMode CompositeMode

Inherited from UIElement

CompositeModeProperty CompositeModeProperty CompositeModeProperty

Inherited from UIElement

Content Content Content

Inherited from Windows.UI.Xaml.ControlsControl.Content

ContentProperty ContentProperty ContentProperty

Inherited from ContentControl

ContentTemplate ContentTemplate ContentTemplate

Inherited from ContentControl

ContentTemplateProperty ContentTemplateProperty ContentTemplateProperty

Inherited from ContentControl

ContentTemplateRoot ContentTemplateRoot ContentTemplateRoot

Inherited from ContentControl

ContentTemplateSelector ContentTemplateSelector ContentTemplateSelector

Inherited from ContentControl

ContentTemplateSelectorProperty ContentTemplateSelectorProperty ContentTemplateSelectorProperty

Inherited from ContentControl

ContentTransitions ContentTransitions ContentTransitions

Inherited from ContentControl

ContentTransitionsProperty ContentTransitionsProperty ContentTransitionsProperty

Inherited from ContentControl

ContextFlyout ContextFlyout ContextFlyout

Inherited from UIElement

ContextFlyoutProperty ContextFlyoutProperty ContextFlyoutProperty

Inherited from UIElement

DataContext DataContext DataContext

Inherited from FrameworkElement

DataContextProperty DataContextProperty DataContextProperty

Inherited from FrameworkElement

DefaultStyleKey DefaultStyleKey DefaultStyleKey

Inherited from Control

DefaultStyleKeyProperty DefaultStyleKeyProperty DefaultStyleKeyProperty

Inherited from Control

DefaultStyleResourceUri DefaultStyleResourceUri DefaultStyleResourceUri

Inherited from Control

DefaultStyleResourceUriProperty DefaultStyleResourceUriProperty DefaultStyleResourceUriProperty

Inherited from Control

DesiredSize DesiredSize DesiredSize

Inherited from UIElement

Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

DoubleTappedEvent DoubleTappedEvent DoubleTappedEvent

Inherited from UIElement

DragEnterEvent DragEnterEvent DragEnterEvent

Inherited from UIElement

DragLeaveEvent DragLeaveEvent DragLeaveEvent

Inherited from UIElement

DragOverEvent DragOverEvent DragOverEvent

Inherited from UIElement

DropEvent DropEvent DropEvent

Inherited from UIElement

ElementSoundMode ElementSoundMode ElementSoundMode

Inherited from Control

ElementSoundModeProperty ElementSoundModeProperty ElementSoundModeProperty

Inherited from Control

ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked

Inherited from UIElement

ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty

Inherited from UIElement

FlowDirection FlowDirection FlowDirection

Inherited from FrameworkElement

FlowDirectionProperty FlowDirectionProperty FlowDirectionProperty

Inherited from FrameworkElement

FocusState FocusState FocusState

Inherited from Control

FocusStateProperty FocusStateProperty FocusStateProperty

Inherited from Control

FocusVisualMargin FocusVisualMargin FocusVisualMargin

Inherited from FrameworkElement

FocusVisualMarginProperty FocusVisualMarginProperty FocusVisualMarginProperty

Inherited from FrameworkElement

FocusVisualPrimaryBrush FocusVisualPrimaryBrush FocusVisualPrimaryBrush

Inherited from FrameworkElement

FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty

Inherited from FrameworkElement

FocusVisualPrimaryThickness FocusVisualPrimaryThickness FocusVisualPrimaryThickness

Inherited from FrameworkElement

FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty

Inherited from FrameworkElement

FocusVisualSecondaryBrush FocusVisualSecondaryBrush FocusVisualSecondaryBrush

Inherited from FrameworkElement

FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty

Inherited from FrameworkElement

FocusVisualSecondaryThickness FocusVisualSecondaryThickness FocusVisualSecondaryThickness

Inherited from FrameworkElement

FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty

Inherited from FrameworkElement

FontFamily FontFamily FontFamily

Inherited from Control

FontFamilyProperty FontFamilyProperty FontFamilyProperty

Inherited from Control

FontSize FontSize FontSize

Inherited from Control

FontSizeProperty FontSizeProperty FontSizeProperty

Inherited from Control

FontStretch FontStretch FontStretch

Inherited from Control

FontStretchProperty FontStretchProperty FontStretchProperty

Inherited from Control

FontStyle FontStyle FontStyle

Inherited from Control

FontStyleProperty FontStyleProperty FontStyleProperty

Inherited from Control

FontWeight FontWeight FontWeight

Inherited from Control

FontWeightProperty FontWeightProperty FontWeightProperty

Inherited from Control

Foreground Foreground Foreground

Inherited from Control

ForegroundProperty ForegroundProperty ForegroundProperty

Inherited from Control

GettingFocusEvent GettingFocusEvent GettingFocusEvent

Inherited from UIElement

Height Height Height

Inherited from FrameworkElement

HeightProperty HeightProperty HeightProperty

Inherited from FrameworkElement

HighContrastAdjustment HighContrastAdjustment HighContrastAdjustment

Inherited from UIElement

HighContrastAdjustmentProperty HighContrastAdjustmentProperty HighContrastAdjustmentProperty

Inherited from UIElement

HoldingEvent HoldingEvent HoldingEvent

Inherited from UIElement

HorizontalAlignment HorizontalAlignment HorizontalAlignment

Inherited from FrameworkElement

HorizontalAlignmentProperty HorizontalAlignmentProperty HorizontalAlignmentProperty

Inherited from FrameworkElement

HorizontalContentAlignment HorizontalContentAlignment HorizontalContentAlignment

Inherited from Control

HorizontalContentAlignmentProperty HorizontalContentAlignmentProperty HorizontalContentAlignmentProperty

Inherited from Control

IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope

Inherited from UIElement

IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty

Inherited from UIElement

IsDoubleTapEnabled IsDoubleTapEnabled IsDoubleTapEnabled

Inherited from UIElement

IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty

Inherited from UIElement

IsEnabled IsEnabled IsEnabled

Inherited from Control

IsEnabledProperty IsEnabledProperty IsEnabledProperty

Inherited from Control

IsFocusEngaged IsFocusEngaged IsFocusEngaged

Inherited from Control

IsFocusEngagedProperty IsFocusEngagedProperty IsFocusEngagedProperty

Inherited from Control

IsFocusEngagementEnabled IsFocusEngagementEnabled IsFocusEngagementEnabled

Inherited from Control

IsFocusEngagementEnabledProperty IsFocusEngagementEnabledProperty IsFocusEngagementEnabledProperty

Inherited from Control

IsHitTestVisible IsHitTestVisible IsHitTestVisible

Inherited from UIElement

IsHitTestVisibleProperty IsHitTestVisibleProperty IsHitTestVisibleProperty

Inherited from UIElement

IsHoldingEnabled IsHoldingEnabled IsHoldingEnabled

Inherited from UIElement

IsHoldingEnabledProperty IsHoldingEnabledProperty IsHoldingEnabledProperty

Inherited from UIElement

IsPointerOver IsPointerOver IsPointerOver

Gets a value that indicates whether a device pointer is located over this button control.

public : Platform::Boolean IsPointerOver { get; }
public bool IsPointerOver { get; }
Public ReadOnly Property IsPointerOver As bool
Value
Platform::Boolean bool bool

True if a pointer is over the button control; otherwise false. The default is false.

IsPointerOverProperty IsPointerOverProperty IsPointerOverProperty

Identifies the IsPointerOver dependency property.

public : static DependencyProperty IsPointerOverProperty { get; }
public static DependencyProperty IsPointerOverProperty { get; }
Public Static ReadOnly Property IsPointerOverProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsPointerOver dependency property.

IsPressed IsPressed IsPressed

Gets a value that indicates whether a ButtonBase is currently in a pressed state.

public : Platform::Boolean IsPressed { get; }
public bool IsPressed { get; }
Public ReadOnly Property IsPressed As bool
Value
Platform::Boolean bool bool

True if the ButtonBase is in a pressed state; otherwise false. The default is false.

IsPressedProperty IsPressedProperty IsPressedProperty

Identifies the IsPressed dependency property.

public : static DependencyProperty IsPressedProperty { get; }
public static DependencyProperty IsPressedProperty { get; }
Public Static ReadOnly Property IsPressedProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsPressed dependency property.

IsRightTapEnabled IsRightTapEnabled IsRightTapEnabled

Inherited from UIElement

IsRightTapEnabledProperty IsRightTapEnabledProperty IsRightTapEnabledProperty

Inherited from UIElement

IsTabStop IsTabStop IsTabStop

Inherited from Control

IsTabStopProperty IsTabStopProperty IsTabStopProperty

Inherited from Control

IsTapEnabled IsTapEnabled IsTapEnabled

Inherited from UIElement

IsTapEnabledProperty IsTapEnabledProperty IsTapEnabledProperty

Inherited from UIElement

IsTemplateFocusTargetProperty IsTemplateFocusTargetProperty IsTemplateFocusTargetProperty

Inherited from Control

IsTemplateKeyTipTargetProperty IsTemplateKeyTipTargetProperty IsTemplateKeyTipTargetProperty

Inherited from Control

IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled

Inherited from Control

IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty

Inherited from Control

KeyDownEvent KeyDownEvent KeyDownEvent

Inherited from UIElement

KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset

Inherited from UIElement

KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty

Inherited from UIElement

KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode

Inherited from UIElement

KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty

Inherited from UIElement

KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset

Inherited from UIElement

KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty

Inherited from UIElement

KeyUpEvent KeyUpEvent KeyUpEvent

Inherited from UIElement

KeyboardAccelerators KeyboardAccelerators KeyboardAccelerators

Inherited from UIElement

Language Language Language

Inherited from FrameworkElement

LanguageProperty LanguageProperty LanguageProperty

Inherited from FrameworkElement

Lights Lights Lights

Inherited from UIElement

LightsProperty LightsProperty LightsProperty

Inherited from UIElement

LosingFocusEvent LosingFocusEvent LosingFocusEvent

Inherited from UIElement

ManipulationCompletedEvent ManipulationCompletedEvent ManipulationCompletedEvent

Inherited from UIElement

ManipulationDeltaEvent ManipulationDeltaEvent ManipulationDeltaEvent

Inherited from UIElement

ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent

Inherited from UIElement

ManipulationMode ManipulationMode ManipulationMode

Inherited from UIElement

ManipulationModeProperty ManipulationModeProperty ManipulationModeProperty

Inherited from UIElement

ManipulationStartedEvent ManipulationStartedEvent ManipulationStartedEvent

Inherited from UIElement

ManipulationStartingEvent ManipulationStartingEvent ManipulationStartingEvent

Inherited from UIElement

Margin Margin Margin

Inherited from FrameworkElement

MarginProperty MarginProperty MarginProperty

Inherited from FrameworkElement

MaxHeight MaxHeight MaxHeight

Inherited from FrameworkElement

MaxHeightProperty MaxHeightProperty MaxHeightProperty

Inherited from FrameworkElement

MaxWidth MaxWidth MaxWidth

Inherited from FrameworkElement

MaxWidthProperty MaxWidthProperty MaxWidthProperty

Inherited from FrameworkElement

MinHeight MinHeight MinHeight

Inherited from FrameworkElement

MinHeightProperty MinHeightProperty MinHeightProperty

Inherited from FrameworkElement

MinWidth MinWidth MinWidth

Inherited from FrameworkElement

MinWidthProperty MinWidthProperty MinWidthProperty

Inherited from FrameworkElement

Name Name Name

Inherited from FrameworkElement

NameProperty NameProperty NameProperty

Inherited from FrameworkElement

NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent

Inherited from UIElement

Opacity Opacity Opacity

Inherited from UIElement

OpacityProperty OpacityProperty OpacityProperty

Inherited from UIElement

Padding Padding Padding

Inherited from Control

PaddingProperty PaddingProperty PaddingProperty

Inherited from Control

Parent Parent Parent

Inherited from FrameworkElement

PointerCanceledEvent PointerCanceledEvent PointerCanceledEvent

Inherited from UIElement

PointerCaptureLostEvent PointerCaptureLostEvent PointerCaptureLostEvent

Inherited from UIElement

PointerCaptures PointerCaptures PointerCaptures

Inherited from UIElement

PointerCapturesProperty PointerCapturesProperty PointerCapturesProperty

Inherited from UIElement

PointerEnteredEvent PointerEnteredEvent PointerEnteredEvent

Inherited from UIElement

PointerExitedEvent PointerExitedEvent PointerExitedEvent

Inherited from UIElement

PointerMovedEvent PointerMovedEvent PointerMovedEvent

Inherited from UIElement

PointerPressedEvent PointerPressedEvent PointerPressedEvent

Inherited from UIElement

PointerReleasedEvent PointerReleasedEvent PointerReleasedEvent

Inherited from UIElement

PointerWheelChangedEvent PointerWheelChangedEvent PointerWheelChangedEvent

Inherited from UIElement

PreviewKeyDownEvent PreviewKeyDownEvent PreviewKeyDownEvent

Inherited from UIElement

PreviewKeyUpEvent PreviewKeyUpEvent PreviewKeyUpEvent

Inherited from UIElement

Projection Projection Projection

Inherited from UIElement

ProjectionProperty ProjectionProperty ProjectionProperty

Inherited from UIElement

RenderSize RenderSize RenderSize

Inherited from UIElement

RenderTransform RenderTransform RenderTransform

Inherited from UIElement

RenderTransformOrigin RenderTransformOrigin RenderTransformOrigin

Inherited from UIElement

RenderTransformOriginProperty RenderTransformOriginProperty RenderTransformOriginProperty

Inherited from UIElement

RenderTransformProperty RenderTransformProperty RenderTransformProperty

Inherited from UIElement

RequestedTheme RequestedTheme RequestedTheme

Inherited from FrameworkElement

RequestedThemeProperty RequestedThemeProperty RequestedThemeProperty

Inherited from FrameworkElement

RequiresPointer RequiresPointer RequiresPointer

Inherited from Control

RequiresPointerProperty RequiresPointerProperty RequiresPointerProperty

Inherited from Control

Resources Resources Resources

Inherited from FrameworkElement

RightTappedEvent RightTappedEvent RightTappedEvent

Inherited from UIElement

Style Style Style

Inherited from FrameworkElement

StyleProperty StyleProperty StyleProperty

Inherited from FrameworkElement

TabFocusNavigation TabFocusNavigation TabFocusNavigation

Inherited from UIElement

TabFocusNavigationProperty TabFocusNavigationProperty TabFocusNavigationProperty

Inherited from UIElement

TabIndex TabIndex TabIndex

Inherited from Control

TabIndexProperty TabIndexProperty TabIndexProperty

Inherited from Control

TabNavigation TabNavigation TabNavigation

Inherited from Control

TabNavigationProperty TabNavigationProperty TabNavigationProperty

Inherited from Control

Tag Tag Tag

Inherited from FrameworkElement

TagProperty TagProperty TagProperty

Inherited from FrameworkElement

TappedEvent TappedEvent TappedEvent

Inherited from UIElement

Template Template Template

Inherited from Control

TemplateProperty TemplateProperty TemplateProperty

Inherited from Control

Transform3D Transform3D Transform3D

Inherited from UIElement

Transform3DProperty Transform3DProperty Transform3DProperty

Inherited from UIElement

Transitions Transitions Transitions

Inherited from UIElement

TransitionsProperty TransitionsProperty TransitionsProperty

Inherited from UIElement

Triggers Triggers Triggers

Inherited from FrameworkElement

UseLayoutRounding UseLayoutRounding UseLayoutRounding

Inherited from UIElement

UseLayoutRoundingProperty UseLayoutRoundingProperty UseLayoutRoundingProperty

Inherited from UIElement

UseSystemFocusVisuals UseSystemFocusVisuals UseSystemFocusVisuals

Inherited from Control

UseSystemFocusVisualsProperty UseSystemFocusVisualsProperty UseSystemFocusVisualsProperty

Inherited from Control

VerticalAlignment VerticalAlignment VerticalAlignment

Inherited from FrameworkElement

VerticalAlignmentProperty VerticalAlignmentProperty VerticalAlignmentProperty

Inherited from FrameworkElement

VerticalContentAlignment VerticalContentAlignment VerticalContentAlignment

Inherited from Control

VerticalContentAlignmentProperty VerticalContentAlignmentProperty VerticalContentAlignmentProperty

Inherited from Control

Visibility Visibility Visibility

Inherited from UIElement

VisibilityProperty VisibilityProperty VisibilityProperty

Inherited from UIElement

Width Width Width

Inherited from FrameworkElement

WidthProperty WidthProperty WidthProperty

Inherited from FrameworkElement

XYFocusDown XYFocusDown XYFocusDown

Inherited from Control

XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy

Inherited from UIElement

XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty

Inherited from UIElement

XYFocusDownProperty XYFocusDownProperty XYFocusDownProperty

Inherited from Control

XYFocusKeyboardNavigation XYFocusKeyboardNavigation XYFocusKeyboardNavigation

Inherited from UIElement

XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty

Inherited from UIElement

XYFocusLeft XYFocusLeft XYFocusLeft

Inherited from Control

XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy

Inherited from UIElement

XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty

Inherited from UIElement

XYFocusLeftProperty XYFocusLeftProperty XYFocusLeftProperty

Inherited from Control

XYFocusRight XYFocusRight XYFocusRight

Inherited from Control

XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy

Inherited from UIElement

XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty

Inherited from UIElement

XYFocusRightProperty XYFocusRightProperty XYFocusRightProperty

Inherited from Control

XYFocusUp XYFocusUp XYFocusUp

Inherited from Control

XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy

Inherited from UIElement

XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty

Inherited from UIElement

XYFocusUpProperty XYFocusUpProperty XYFocusUpProperty

Inherited from Control

Events

AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed

Inherited from UIElement

AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested

Inherited from UIElement

AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked

Inherited from UIElement

ActualThemeChanged ActualThemeChanged ActualThemeChanged

Inherited from FrameworkElement

CharacterReceived CharacterReceived CharacterReceived

Inherited from UIElement

Click Click Click

Occurs when a button control is clicked.

public : event RoutedEventHandler Click<>
public event RoutedEventHandler Click<>
Public Event RoutedEventHandler Click( Of )
<button Click="eventhandler"/>

Examples

The following example demonstrates handling the Click event and setting the IsEnabled property of a Button, which inherits from ButtonBase.

<StackPanel>   
    <Button Content="Submit" 
            Click="submitButtonClick"/>
    <TextBlock x:Name="textBlock1"/>
</StackPanel>
void submitButtonClick(object sender, RoutedEventArgs e)
{
    textBlock1.Text = "You clicked the Submit button.";
}
Private Sub submitButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.Text = "You clicked the Submit button."
End Sub

ContextCanceled ContextCanceled ContextCanceled

Inherited from UIElement

ContextRequested ContextRequested ContextRequested

Inherited from UIElement

DataContextChanged DataContextChanged DataContextChanged

Inherited from FrameworkElement

DoubleTapped DoubleTapped DoubleTapped

Inherited from UIElement

DragEnter DragEnter DragEnter

Inherited from UIElement

DragLeave DragLeave DragLeave

Inherited from UIElement

DragOver DragOver DragOver

Inherited from UIElement

DragStarting DragStarting DragStarting

Inherited from UIElement

Drop Drop Drop

Inherited from UIElement

DropCompleted DropCompleted DropCompleted

Inherited from UIElement

FocusDisengaged FocusDisengaged FocusDisengaged

Inherited from Control

FocusEngaged FocusEngaged FocusEngaged

Inherited from Control

GettingFocus GettingFocus GettingFocus

Inherited from UIElement

GotFocus GotFocus GotFocus

Inherited from UIElement

Holding Holding Holding

Inherited from UIElement

IsEnabledChanged IsEnabledChanged IsEnabledChanged

Inherited from Control

KeyDown KeyDown KeyDown

Inherited from UIElement

KeyUp KeyUp KeyUp

Inherited from UIElement

LayoutUpdated LayoutUpdated LayoutUpdated

Inherited from FrameworkElement

Loaded Loaded Loaded

Inherited from FrameworkElement

Loading Loading Loading

Inherited from FrameworkElement

LosingFocus LosingFocus LosingFocus

Inherited from UIElement

LostFocus LostFocus LostFocus

Inherited from UIElement

ManipulationCompleted ManipulationCompleted ManipulationCompleted

Inherited from UIElement

ManipulationDelta ManipulationDelta ManipulationDelta

Inherited from UIElement

ManipulationInertiaStarting ManipulationInertiaStarting ManipulationInertiaStarting

Inherited from UIElement

ManipulationStarted ManipulationStarted ManipulationStarted

Inherited from UIElement

ManipulationStarting ManipulationStarting ManipulationStarting

Inherited from UIElement

NoFocusCandidateFound NoFocusCandidateFound NoFocusCandidateFound

Inherited from UIElement

PointerCanceled PointerCanceled PointerCanceled

Inherited from UIElement

PointerCaptureLost PointerCaptureLost PointerCaptureLost

Inherited from UIElement

PointerEntered PointerEntered PointerEntered

Inherited from UIElement

PointerExited PointerExited PointerExited

Inherited from UIElement

PointerMoved PointerMoved PointerMoved

Inherited from UIElement

PointerPressed PointerPressed PointerPressed

Inherited from UIElement

PointerReleased PointerReleased PointerReleased

Inherited from UIElement

PointerWheelChanged PointerWheelChanged PointerWheelChanged

Inherited from UIElement

PreviewKeyDown PreviewKeyDown PreviewKeyDown

Inherited from UIElement

PreviewKeyUp PreviewKeyUp PreviewKeyUp

Inherited from UIElement

ProcessKeyboardAccelerators ProcessKeyboardAccelerators ProcessKeyboardAccelerators

Inherited from UIElement

RightTapped RightTapped RightTapped

Inherited from UIElement

SizeChanged SizeChanged SizeChanged

Inherited from FrameworkElement

Tapped Tapped Tapped

Inherited from UIElement

Unloaded Unloaded Unloaded

Inherited from FrameworkElement

Methods

AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean)

Inherited from UIElement

ApplyTemplate ApplyTemplate ApplyTemplate

Inherited from Control

Arrange(Rect) Arrange(Rect) Arrange(Rect)

Inherited from UIElement

ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size)

Inherited from FrameworkElement

CancelDirectManipulations CancelDirectManipulations CancelDirectManipulations

Inherited from UIElement

CapturePointer(Pointer) CapturePointer(Pointer) CapturePointer(Pointer)

Inherited from UIElement

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

DeferTree(DependencyObject) DeferTree(DependencyObject) DeferTree(DependencyObject)

Inherited from FrameworkElement

FindName(String) FindName(String) FindName(String)

Inherited from FrameworkElement

FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect)

Inherited from UIElement

Focus(FocusState) Focus(FocusState) Focus(FocusState)

Inherited from Control

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty)

Inherited from FrameworkElement

GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder

Inherited from UIElement

GetIsTemplateFocusTarget(FrameworkElement) GetIsTemplateFocusTarget(FrameworkElement) GetIsTemplateFocusTarget(FrameworkElement)

Inherited from Control

GetIsTemplateKeyTipTarget(DependencyObject) GetIsTemplateKeyTipTarget(DependencyObject) GetIsTemplateKeyTipTarget(DependencyObject)

Inherited from Control

GetTemplateChild(String) GetTemplateChild(String) GetTemplateChild(String)

Inherited from Control

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean)

Inherited from FrameworkElement

InvalidateArrange InvalidateArrange InvalidateArrange

Inherited from UIElement

InvalidateMeasure InvalidateMeasure InvalidateMeasure

Inherited from UIElement

Measure(Size) Measure(Size) Measure(Size)

Inherited from UIElement

MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size)

Inherited from FrameworkElement

OnApplyTemplate OnApplyTemplate OnApplyTemplate

Inherited from FrameworkElement

OnCharacterReceived(CharacterReceivedRoutedEventArgs) OnCharacterReceived(CharacterReceivedRoutedEventArgs) OnCharacterReceived(CharacterReceivedRoutedEventArgs)

Inherited from Control

OnContentChanged(Object,Object) OnContentChanged(Object,Object) OnContentChanged(Object,Object)

Inherited from ContentControl

OnContentTemplateChanged(DataTemplate,DataTemplate) OnContentTemplateChanged(DataTemplate,DataTemplate) OnContentTemplateChanged(DataTemplate,DataTemplate)

Inherited from ContentControl

OnContentTemplateSelectorChanged(DataTemplateSelector,DataTemplateSelector) OnContentTemplateSelectorChanged(DataTemplateSelector,DataTemplateSelector) OnContentTemplateSelectorChanged(DataTemplateSelector,DataTemplateSelector)

Inherited from ContentControl

OnCreateAutomationPeer OnCreateAutomationPeer OnCreateAutomationPeer

Inherited from UIElement

OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren

Inherited from UIElement

OnDoubleTapped(DoubleTappedRoutedEventArgs) OnDoubleTapped(DoubleTappedRoutedEventArgs) OnDoubleTapped(DoubleTappedRoutedEventArgs)

Inherited from Control

OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs)

Inherited from Control

OnDragLeave(DragEventArgs) OnDragLeave(DragEventArgs) OnDragLeave(DragEventArgs)

Inherited from Control

OnDragOver(DragEventArgs) OnDragOver(DragEventArgs) OnDragOver(DragEventArgs)

Inherited from Control

OnDrop(DragEventArgs) OnDrop(DragEventArgs) OnDrop(DragEventArgs)

Inherited from Control

OnGotFocus(RoutedEventArgs) OnGotFocus(RoutedEventArgs) OnGotFocus(RoutedEventArgs)

Inherited from Control

OnHolding(HoldingRoutedEventArgs) OnHolding(HoldingRoutedEventArgs) OnHolding(HoldingRoutedEventArgs)

Inherited from Control

OnKeyDown(KeyRoutedEventArgs) OnKeyDown(KeyRoutedEventArgs) OnKeyDown(KeyRoutedEventArgs)

Inherited from Control

OnKeyUp(KeyRoutedEventArgs) OnKeyUp(KeyRoutedEventArgs) OnKeyUp(KeyRoutedEventArgs)

Inherited from Control

OnLostFocus(RoutedEventArgs) OnLostFocus(RoutedEventArgs) OnLostFocus(RoutedEventArgs)

Inherited from Control

OnManipulationCompleted(ManipulationCompletedRoutedEventArgs) OnManipulationCompleted(ManipulationCompletedRoutedEventArgs) OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)

Inherited from Control

OnManipulationDelta(ManipulationDeltaRoutedEventArgs) OnManipulationDelta(ManipulationDeltaRoutedEventArgs) OnManipulationDelta(ManipulationDeltaRoutedEventArgs)

Inherited from Control

OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs) OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs) OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)

Inherited from Control

OnManipulationStarted(ManipulationStartedRoutedEventArgs) OnManipulationStarted(ManipulationStartedRoutedEventArgs) OnManipulationStarted(ManipulationStartedRoutedEventArgs)

Inherited from Control

OnManipulationStarting(ManipulationStartingRoutedEventArgs) OnManipulationStarting(ManipulationStartingRoutedEventArgs) OnManipulationStarting(ManipulationStartingRoutedEventArgs)

Inherited from Control

OnPointerCanceled(PointerRoutedEventArgs) OnPointerCanceled(PointerRoutedEventArgs) OnPointerCanceled(PointerRoutedEventArgs)

Inherited from Control

OnPointerCaptureLost(PointerRoutedEventArgs) OnPointerCaptureLost(PointerRoutedEventArgs) OnPointerCaptureLost(PointerRoutedEventArgs)

Inherited from Control

OnPointerEntered(PointerRoutedEventArgs) OnPointerEntered(PointerRoutedEventArgs) OnPointerEntered(PointerRoutedEventArgs)

Inherited from Control

OnPointerExited(PointerRoutedEventArgs) OnPointerExited(PointerRoutedEventArgs) OnPointerExited(PointerRoutedEventArgs)

Inherited from Control

OnPointerMoved(PointerRoutedEventArgs) OnPointerMoved(PointerRoutedEventArgs) OnPointerMoved(PointerRoutedEventArgs)

Inherited from Control

OnPointerPressed(PointerRoutedEventArgs) OnPointerPressed(PointerRoutedEventArgs) OnPointerPressed(PointerRoutedEventArgs)

Inherited from Control

OnPointerReleased(PointerRoutedEventArgs) OnPointerReleased(PointerRoutedEventArgs) OnPointerReleased(PointerRoutedEventArgs)

Inherited from Control

OnPointerWheelChanged(PointerRoutedEventArgs) OnPointerWheelChanged(PointerRoutedEventArgs) OnPointerWheelChanged(PointerRoutedEventArgs)

Inherited from Control

OnPreviewKeyDown(KeyRoutedEventArgs) OnPreviewKeyDown(KeyRoutedEventArgs) OnPreviewKeyDown(KeyRoutedEventArgs)

Inherited from Control

OnPreviewKeyUp(KeyRoutedEventArgs) OnPreviewKeyUp(KeyRoutedEventArgs) OnPreviewKeyUp(KeyRoutedEventArgs)

Inherited from Control

OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

Inherited from UIElement

OnRightTapped(RightTappedRoutedEventArgs) OnRightTapped(RightTappedRoutedEventArgs) OnRightTapped(RightTappedRoutedEventArgs)

Inherited from Control

OnTapped(TappedRoutedEventArgs) OnTapped(TappedRoutedEventArgs) OnTapped(TappedRoutedEventArgs)

Inherited from Control

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer)

Inherited from UIElement

ReleasePointerCaptures ReleasePointerCaptures ReleasePointerCaptures

Inherited from UIElement

RemoveFocusEngagement RemoveFocusEngagement RemoveFocusEngagement

Inherited from Control

RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object)

Inherited from UIElement

SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase)

Inherited from FrameworkElement

SetIsTemplateFocusTarget(FrameworkElement,Boolean) SetIsTemplateFocusTarget(FrameworkElement,Boolean) SetIsTemplateFocusTarget(FrameworkElement,Boolean)

Inherited from Control

SetIsTemplateKeyTipTarget(DependencyObject,Boolean) SetIsTemplateKeyTipTarget(DependencyObject,Boolean) SetIsTemplateKeyTipTarget(DependencyObject,Boolean)

Inherited from Control

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

StartBringIntoView StartBringIntoView StartBringIntoView

Inherited from UIElement

StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions)

Inherited from UIElement

StartDragAsync(PointerPoint) StartDragAsync(PointerPoint) StartDragAsync(PointerPoint)

Inherited from UIElement

TransformToVisual(UIElement) TransformToVisual(UIElement) TransformToVisual(UIElement)

Inherited from UIElement

TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

Inherited from UIElement

TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer)

Inherited from UIElement

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

UpdateLayout UpdateLayout UpdateLayout

Inherited from UIElement