I have several RadTextbox's all bound using two way binding. In my model and view model, everything implements INotifyPropertyChange.
I have one textbox that is mapped to a string and if I press the clear button on the textbox (and after binding.Updatesource on the textbox binding is executed), the setter of the bound field executes.
However, I have one textbox that is mapped to an integer and if I press the clear button that textbox (and after binding.UpdateSource on the textbox is executed), the setter of the bound field does not execute. It will execute just fine if I change the value of the textbox with another integer.
How come or what does the X Clear button do when bound to an integer to not change the value of the bound field?
The clear button works on the Publisher textbox but does not on the Page Count textbox
<telerikPrimitives:RadTextBox x:Name="publisherTextBox" Header="Publisher"
HeaderStyle="{StaticResource HeaderAccentStyle}"
Text="{Binding Publisher, Mode=TwoWay}" Grid.Row ="3"/>
<telerikPrimitives:RadTextBox x:Name="pageCountTextBox" Header="Page Count"
HeaderStyle="{StaticResource HeaderAccentStyle}"
InputScope="Number"
Text="{Binding NoOfPages, Mode=TwoWay}" Grid.Row ="5" />
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_NoOfPages", DbType = "Int", UpdateCheck = UpdateCheck.Never)]
public int NoOfPages
{
get
{
return this._NoOfPages;
}
set
{
if ((this._NoOfPages != value))
{
this.OnNoOfPagesChanging(value);
this.SendPropertyChanging();
this._NoOfPages = value;
this.SendPropertyChanged("NoOfPages");
this.OnNoOfPagesChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Publisher", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]
public string Publisher
{
get
{
return this._Publisher;
}
set
{
if ((this._Publisher != value))
{
this.OnPublisherChanging(value);
this.SendPropertyChanging();
this._Publisher = value;
this.SendPropertyChanged("Publisher");
this.OnPublisherChanged();
}
}
}