I Have a text box, depending on the text box value i need to enable/disable other text Boxes.I am using MVVM Pattern.
So here's my problem , whenever i enter some text in TextBox1 ,the Setter for TextBox1 is getting fired and i am able to check in if loop ,whether valus exists and i am disabling other text boxes. Now, when there is single value in text box say "9" and i am deleting / Backspacing it the Set event is not getting triggered in order to enable the other Text Boxes.
View:
<TextBox Text = {Binding TextBox1 , UpdateSourceTrigger = PropertyChanged,Mode= TwoWay}/>
<TextBox Text = {Binding TextBox2 , UpdateSourceTrigger = PropertyChanged,Mode= TwoWay}/>
<TextBox Text = {Binding TextBox3 , UpdateSourceTrigger = PropertyChanged,Mode= TwoWay}/>
View Model:
private int_textBox1;
public int TextBox1
{
get {return _textBox1;}
set
{
_textBox1= value;
if(value > 0)
{
//Code for Disabling Other Text Boxes (TextBox2 and TextBox3)
}
else
{
// Code for Enabling Other Text Boxes (TextBox2 and TextBox3)
}
NotifyPropertyChanged("TextBox1");
}
}