Can we update a source that is not DepencyProperty or not compatible with INotifyPropertyChanged

I have a business object that comes from the core of an application. This object does not inherit from INotifyPropertyChanged. It contains some property that XAML code binds to it. I only want to update properties dynamically, not the UI (OneWayToSource style).

For example, if I change the text of the textbox, the original element is not updated. The Silverlight limitation is that if the object does not implement INotifyPropertyChanged or uses DepencyProperties that the binding source cannot be updated?

+2


a source to share


2 answers


The source property does not need to be a dependency property, but the class that provides it must implement INotifyPropertyChanged

.



If you have a binding to TextBox

use edit mode TwoWay

, the textbox should update the binding property, even if it is a regular "vanila" property. Note that by default the focus should be left on the TextBox to update the binding.

+2


a source


If your business object has a method set

for a property that you want to update, then the value must be updated if the value entered does not throw an exception.



Without implementing INotifyPropertyChanged

, only visual feedback hinders.

0


a source







All Articles