Hi,
I am having a property of int type in my view model which is bound to a text box. Everything works properly, two way binding works fine except in one case -
If i clear the value of text box, property setter doesn't gets called and although value is cleared in text box, property still holds the previous value.
has anyone faced similar issue, is there any workaround for this?
Here is the property -
public int MaxOccurrences
{
get
{
return this.maxOccurrences;
}
set
{
if (this.maxOccurrences != value)
{
this.maxOccurrences = value;
base.RaisePropertyChanged("MaxOccurrences");
}
}
}
Here is how I am binding the property in xaml -
<TextBox Text="{Binding Path=MaxOccurrences, Mode=TwoWay,
NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center" Width="30" Margin="0,0,5,0"/>