XTOOLKIT
XTOOLKIT
Collection of utilities, helper classes and WPF controls

Number Box WPF control in xToolkit


This WPF control is available in 2 version: for double value and integer values.

Integer and Double number boxes
Integer and Double number boxes

Bind the View Model property in the XAML to the Value dependency property.

public class NumberBoxVM
{
    public double DoubleVal { get; set; } = 10.5;
    public int IntegerVal { get; set; } = 100;
}

<UserControl x:Class="Wpf.Docs.NumberBoxControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ctrls="clr-namespace:Xarial.XToolkit.Wpf.Controls;assembly=Xarial.XToolkit.Wpf">
    <StackPanel Orientation="Vertical">
        <ctrls:NumberBoxDouble Margin="2" Value="{Binding Path=DoubleVal}"/>
        <ctrls:NumberBoxInteger Margin="2" Value="{Binding Path=IntegerVal}"/>
    </StackPanel>
</UserControl>


Powered by Docify