I have a property in my view model which returns a constant under some conditions.
which is implemented similiar to this:
class Tmp : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public String Text
{
get { return "testing"; }
set
{
PropertyChanged(this,new PropertyChangedEventArgs("Text")); }
}
}
so the property Text alwasys returns "testing".
I bound this to a text box like :
<TextBox Text="{Binding Path=Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
When the application starts, the textbox correclty says testing.
now when I type something in the text box the setter gets called, which calls PropertyChanged.
After this something ( probably the GUI ) calls the getter and gets the value "testing".
However the text in the textbox is not changed back to testing.
So I can type "abc" into the text box, and text box displays "abc" even though the model is just storing "testing".
why isnt the text in the text box not reset to "testing" at each keystroke?