I have an entry that binds to a int? property in my view model. The problem is that if at a first time I have a value and I delete it, the notification is not arise to the view model.
I would like that if the user delete the value of the entry, to be notifiy to the view model.
This is my code:
View:
<Entry Text="{Binding MyIntProperty}" Keyboard="Numeric"
HorizontalTextAlignment="End"
Grid.Column="1"/>
The ViewModel:
[ObservableProperty]
int? _myIntProperty;
partial void OnMyIntPropertyChanged(int? value)
{
//Do Something if it is null.
}
I am using CommunityToolkit to handle the notification. When the value of MyIntProperty changes, the code in OnMyIntpropertyChanged() is executed.
The problem is that when user delete the data in the entry control, I guess it is null and then it is not notifify the change. I would like to can do something if the value changes to null.
Thanks.