I made my own;
the xaml
<StackPanel Orientation="Horizontal">
<TextBox x:Name="txtNum" x:FieldModifier="private" Margin="5,5,0,5" Width="50" Text="0" TextChanged="txtNum_TextChanged" />
<Button x:Name="cmdUp" x:FieldModifier="private" Margin="5,5,0,5" Content="˄" Width="20" Click="cmdUp_Click" />
<Button x:Name="cmdDown" x:FieldModifier="private" Margin="0,5,0,5" Content="˅" Width="20" Click="cmdDown_Click" />
</StackPanel>
and the code behind
private int _numValue = 0;
public int NumValue
{
get { return _numValue; }
set
{
_numValue = value;
txtNum.Text = value.ToString();
}
}
public NumberUpDown()
{
InitializeComponent();
txtNum.Text = _numValue.ToString();
}
private void cmdUp_Click(object sender, RoutedEventArgs e)
{
NumValue++;
}
private void cmdDown_Click(object sender, RoutedEventArgs e)
{
NumValue--;
}
private void txtNum_TextChanged(object sender, TextChangedEventArgs e)
{
if (!int.TryParse(txtNum.Text, out _numValue))
txtNum.Text = _numValue.ToString();
}