Skip to main content

RepeatButton

The RepeatButton is a control that has the added feature of regularly generating click events while the button is being pressed down.

Useful Properties

You will probably use these properties most often:

PropertyDescription
DelayThe time (milliseconds) to wait before repeated click generation begins. Default is 300.
IntervalThe time (milliseconds) between clicks being generated. Default is 100.

Example

This example shows a repeat button generating click events with the default interval and delay.

<UserControl xmlns="https://github.com/avaloniaui"
             Padding="20">
  <RepeatButton Click="OnClick"
                HorizontalAlignment="Center"
                VerticalAlignment="Center">
    Press and hold down
  </RepeatButton>
</UserControl>
Preview
Loading Avalonia Preview...

More Information

info

For the complete API documentation about this control, see here.

info

View the source code on GitHub RepeatButton.cs

Discussion

Have questions or feedback? Join the conversation below.