This project has moved and is read-only. For the latest updates, please go here.


Derives from Xceed.Wpf.Toolkit.Spinner

The ButtonSpinner control allows you to add button spinners to any element and then respond to the Spin event to manipulate that element. The Spin event lets the developer know which direction the buttons are spinning; SpinDirection.Increase indicates an increment, SpinDirection.Decrease indicates a decrement.


You can wrap any element by placing it inside the content area of the ButtonSpinner control. As an example, lets create our own simple numeric up/down control


        <xctk:ButtonSpinner Spin="ButtonSpinner_Spin">
            <TextBox Text="0" HorizontalContentAlignment="Right" />

Code Behind
        private void ButtonSpinner_Spin(object sender, Microsoft.Windows.Controls.SpinEventArgs e)
            ButtonSpinner spinner = (ButtonSpinner)sender;
            TextBox txtBox = (TextBox)spinner.Content;

            int value = String.IsNullOrEmpty(txtBox.Text) ? 0 : Convert.ToInt32(txtBox.Text);
            if (e.Direction == Microsoft.Windows.Controls.SpinDirection.Increase)
            txtBox.Text = value.ToString();


Property Description
AllowSpin Gets or sets a value indicating whether the spinner buttons are enabled.
Content Gets or sets the content of the ButtonSpinner.
ShowButtonSpinner Gets or sets a value indicating whether the ButtonSpinner is visible.
ValidSpinDirection Gets or sets the valid direction for the Spinner (None, Increase or Decrease). By default, Increase or Decrease. (Inherited from Spinner)


Event Description
Spin Raised when spinning is initiated by the end-user. (Inherited from Spinner)

Support this project, check out the Plus Edition.

Last edited Jun 1, 2016 at 3:46 PM by dlafontaine, version 11


hbrizuela Mar 22, 2017 at 7:08 PM 
it looks like Microsoft.Windows.Controls does not have SpinDirection defined
I rather use e.Direction == Xceed.Wpf.Toolkit.SpinDirection.Increase

SuperJMN Oct 16, 2012 at 8:31 PM 
What is the best way to use this in a MVVM manner?

timhibbard May 8, 2012 at 7:22 PM 
I found an issue with the default padding when using without content. Here is the post about it: