RepeatButton class

Applies to Windows and Windows Phone

Represents a control that fires its Click event repeatedly until the click mode is released.

Inheritance

Object
  DependencyObject
    UIElement
      FrameworkElement
        Control
          ContentControl
            ButtonBase
              RepeatButton

Syntax


public sealed class RepeatButton : ButtonBase


<RepeatButton .../>
-or-
<RepeatButton>
    singleObject
</RepeatButton>
-or-
<RepeatButton ...>stringContent</RepeatButton>

XAML Values

singleObject

A single object element that declares the content.

stringContent

A string that is displayed as content, using the presenter settings in the default template ContentPresenter.

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The RepeatButton class has these types of members:

Constructors

The RepeatButton class has these constructors.

ConstructorDescription
RepeatButton

 

Events

The RepeatButton class has these events.

EventDescription
Click (Inherited from ButtonBase)
DataContextChanged (Inherited from FrameworkElement)
DoubleTapped (Inherited from UIElement)
DragEnter (Inherited from UIElement)
DragLeave (Inherited from UIElement)
DragOver (Inherited from UIElement)
Drop (Inherited from UIElement)
GotFocus (Inherited from UIElement)
Holding (Inherited from UIElement)
IsEnabledChanged (Inherited from Control)
KeyDown (Inherited from UIElement)
KeyUp (Inherited from UIElement)
LayoutUpdated (Inherited from FrameworkElement)
Loaded (Inherited from FrameworkElement)
LostFocus (Inherited from UIElement)
ManipulationCompleted (Inherited from UIElement)
ManipulationDelta (Inherited from UIElement)
ManipulationInertiaStarting (Inherited from UIElement)
ManipulationStarted (Inherited from UIElement)
ManipulationStarting (Inherited from UIElement)
PointerCanceled (Inherited from UIElement)
PointerCaptureLost (Inherited from UIElement)
PointerEntered (Inherited from UIElement)
PointerExited (Inherited from UIElement)
PointerMoved (Inherited from UIElement)
PointerPressed (Inherited from UIElement)
PointerReleased (Inherited from UIElement)
PointerWheelChanged (Inherited from UIElement)
RightTapped (Inherited from UIElement)
SizeChanged (Inherited from FrameworkElement)
Tapped (Inherited from UIElement)
Unloaded (Inherited from FrameworkElement)

 

Methods

The RepeatButton class has these methods. It also inherits methods from the Object class.

MethodDescription
AddHandler (Inherited from UIElement)
ApplyTemplate (Inherited from Control)
Arrange (Inherited from UIElement)
ArrangeOverride (Inherited from FrameworkElement)
CancelDirectManipulations (Inherited from UIElement)
CapturePointer (Inherited from UIElement)
ClearValue (Inherited from DependencyObject)
FindName (Inherited from FrameworkElement)
FindSubElementsForTouchTargeting (Inherited from UIElement)
Focus (Inherited from Control)
GetAnimationBaseValue (Inherited from DependencyObject)
GetBindingExpression (Inherited from FrameworkElement)
GetTemplateChild (Inherited from Control)
GetValue (Inherited from DependencyObject)
GoToElementStateCore (Inherited from FrameworkElement)
InvalidateArrange (Inherited from UIElement)
InvalidateMeasure (Inherited from UIElement)
Measure (Inherited from UIElement)
MeasureOverride (Inherited from FrameworkElement)
OnApplyTemplate (Inherited from FrameworkElement)
OnContentChanged (Inherited from ContentControl)
OnContentTemplateChanged (Inherited from ContentControl)
OnContentTemplateSelectorChanged (Inherited from ContentControl)
OnCreateAutomationPeer (Inherited from UIElement)
OnDisconnectVisualChildren (Inherited from UIElement)
OnDoubleTapped (Inherited from Control)
OnDragEnter (Inherited from Control)
OnDragLeave (Inherited from Control)
OnDragOver (Inherited from Control)
OnDrop (Inherited from Control)
OnGotFocus (Inherited from Control)
OnHolding (Inherited from Control)
OnKeyDown (Inherited from Control)
OnKeyUp (Inherited from Control)
OnLostFocus (Inherited from Control)
OnManipulationCompleted (Inherited from Control)
OnManipulationDelta (Inherited from Control)
OnManipulationInertiaStarting (Inherited from Control)
OnManipulationStarted (Inherited from Control)
OnManipulationStarting (Inherited from Control)
OnPointerCanceled (Inherited from Control)
OnPointerCaptureLost (Inherited from Control)
OnPointerEntered (Inherited from Control)
OnPointerExited (Inherited from Control)
OnPointerMoved (Inherited from Control)
OnPointerPressed (Inherited from Control)
OnPointerReleased (Inherited from Control)
OnPointerWheelChanged (Inherited from Control)
OnRightTapped (Inherited from Control)
OnTapped (Inherited from Control)
ReadLocalValue (Inherited from DependencyObject)
ReleasePointerCapture (Inherited from UIElement)
ReleasePointerCaptures (Inherited from UIElement)
RemoveHandler (Inherited from UIElement)
SetBinding (Inherited from FrameworkElement)
SetValue (Inherited from DependencyObject)
TransformToVisual (Inherited from UIElement)
UpdateLayout (Inherited from UIElement)

 

Properties

The RepeatButton class has these properties.

PropertyAccess typeDescription

ActualHeight

Read-only (Inherited from FrameworkElement)

ActualWidth

Read-only (Inherited from FrameworkElement)

AllowDrop

Read/write (Inherited from UIElement)

Background

Read/write (Inherited from Control)

BaseUri

Read-only (Inherited from FrameworkElement)

BorderBrush

Read/write (Inherited from Control)

BorderThickness

Read/write (Inherited from Control)

CacheMode

Read/write (Inherited from UIElement)

CharacterSpacing

Read/write (Inherited from Control)

ClickMode

Read/write (Inherited from ButtonBase)

Clip

Read/write (Inherited from UIElement)

Command

Read/write (Inherited from ButtonBase)

CommandParameter

Read/write (Inherited from ButtonBase)

CompositeMode

Read/write (Inherited from UIElement)

Content

Read/write (Inherited from ContentControl)

ContentTemplate

Read/write (Inherited from ContentControl)

ContentTemplateRoot

Read-only (Inherited from ContentControl)

ContentTemplateSelector

Read/write (Inherited from ContentControl)

ContentTransitions

Read/write (Inherited from ContentControl)

DataContext

Read/write (Inherited from FrameworkElement)

DefaultStyleKey

Read/write (Inherited from Control)

Delay

Read/write

DelayProperty

Read-only

DesiredSize

Read-only (Inherited from UIElement)

Dispatcher

Read-only (Inherited from DependencyObject)

FlowDirection

Read/write (Inherited from FrameworkElement)

FocusState

Read-only (Inherited from Control)

FontFamily

Read/write (Inherited from Control)

FontSize

Read/write (Inherited from Control)

FontStretch

Read/write (Inherited from Control)

FontStyle

Read/write (Inherited from Control)

FontWeight

Read/write (Inherited from Control)

Foreground

Read/write (Inherited from Control)

Height

Read/write (Inherited from FrameworkElement)

HorizontalAlignment

Read/write (Inherited from FrameworkElement)

HorizontalContentAlignment

Read/write (Inherited from Control)

Interval

Read/write

IntervalProperty

Read-only

IsDoubleTapEnabled

Read/write (Inherited from UIElement)

IsEnabled

Read/write (Inherited from Control)

IsHitTestVisible

Read/write (Inherited from UIElement)

IsHoldingEnabled

Read/write (Inherited from UIElement)

IsPointerOver

Read-only (Inherited from ButtonBase)

IsPressed

Read-only (Inherited from ButtonBase)

IsRightTapEnabled

Read/write (Inherited from UIElement)

IsTabStop

Read/write (Inherited from Control)

IsTapEnabled

Read/write (Inherited from UIElement)

Language

Read/write (Inherited from FrameworkElement)

ManipulationMode

Read/write (Inherited from UIElement)

Margin

Read/write (Inherited from FrameworkElement)

MaxHeight

Read/write (Inherited from FrameworkElement)

MaxWidth

Read/write (Inherited from FrameworkElement)

MinHeight

Read/write (Inherited from FrameworkElement)

MinWidth

Read/write (Inherited from FrameworkElement)

Name

Read/write (Inherited from FrameworkElement)

Opacity

Read/write (Inherited from UIElement)

Padding

Read/write (Inherited from Control)

Parent

Read-only (Inherited from FrameworkElement)

PointerCaptures

Read-only (Inherited from UIElement)

Projection

Read/write (Inherited from UIElement)

RenderSize

Read-only (Inherited from UIElement)

RenderTransform

Read/write (Inherited from UIElement)

RenderTransformOrigin

Read/write (Inherited from UIElement)

RequestedTheme

Read/write (Inherited from FrameworkElement)

Resources

Read/write (Inherited from FrameworkElement)

Style

Read/write (Inherited from FrameworkElement)

TabIndex

Read/write (Inherited from Control)

TabNavigation

Read/write (Inherited from Control)

Tag

Read/write (Inherited from FrameworkElement)

Template

Read/write (Inherited from Control)

Transitions

Read/write (Inherited from UIElement)

Triggers

Read-only (Inherited from FrameworkElement)

UseLayoutRounding

Read/write (Inherited from UIElement)

VerticalAlignment

Read/write (Inherited from FrameworkElement)

VerticalContentAlignment

Read/write (Inherited from Control)

Visibility

Read/write (Inherited from UIElement)

Width

Read/write (Inherited from FrameworkElement)

 

Examples

The following example demonstrates how to use a RepeatButton.


<UserControl x:Class="RepeatButtonEx.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="350" Height="300">

    <StackPanel Margin="10">

         <RepeatButton Content="click and hold for multiple Click events" 
           Click="RepeatButton_Click" Margin="5"
           HorizontalAlignment="Left"/>
        <TextBlock x:Name="clickTextBlock" Text="Number of Clicks:" />

    </StackPanel>

</UserControl>



static int Clicks = 0;
private void RepeatButton_Click(object sender, RoutedEventArgs e)
{
    Clicks += 1;
    clickTextBlock.Text = "Number of Clicks: " + Clicks;
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls.Primitives
Windows::UI::Xaml::Controls::Primitives [C++]

Metadata

Windows.winmd

See also

ButtonBase

 

 

Show:
© 2014 Microsoft