Start Silverlight textblock binding not updating

Silverlight textblock binding not updating

Note that when you bind to a property that is a string, and you clear the value out, the property setter is called with an empty string, not with a null.

Cost - 3 / 5 JJ Keller provides several different options for the driver or manager to choose from and it can make their pricing confusing and price range very wide.

Monthly .50/mo per vehicle, if you provide your own display device...

I narrowed it down to a simple application that has properties for Name and Age, as follows: Age doesn’t get called when the value in the textbox is empty. The interesting part of this is that if I had a button on the form, invoking a method on my View Model, when that method is invoked, the View Model would still have the original age value that was supplied, not knowing that the textbox had been cleared out.

I found this to be quite disturbing and I mentioned it to a couple of people, and they too were surprised by this behavior.

But when I talked to Mitsu Furuta about it, he set me straight.

He explained that Binding takes a very safe approach to calling property setters.

With WPF this is done easily by setting the Update Source Trigger property to Property Changed in the Binding definition, unfortunately this is not available for Silverlight.


 
Dzisiaj jest:
03-Feb-2020 00:44