I have 2 TextBoxes in the window binded with appropriate properties in C# code. One of them is int, so default INotifyPropertyChanged integer validation works great, but the second one is double, but I still can't insert any charachter except a number. How can I change default in validation type? XAML:
<TextBox Grid.Row="3"
Grid.Column="1"
x:Name="priceTextBox"
Width="250"
Height="30"
HorizontalAlignment="Left"
Text="{Binding Price, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Grid.Row="4"
Grid.Column="1"
x:Name="soldCountTextBox"
Width="250"
Height="30"
HorizontalAlignment="Left"
Text="{Binding SoldCount, UpdateSourceTrigger=PropertyChanged}"/>
C#:
public double Price
{
get => _price;
set
{
_price = value;
OnPropertyChanged("Price");
}
}
public int SoldCount
{
get => _soldCount;
set
{
_soldCount = value;
OnPropertyChanged("SoldCount");
}
}