I studied the Caliburn Micro MVVM Framework to understand it, but I ran into some problem. I have a TextBox associated with a string property in my ViewModel, and I would like the property to be updated when the TextBox loses focus.
Normally, I would do this by setting UpdateSourceTrigger in LostFocus to a binding, but I see no way to do this in Caliburn, since it automatically set the property binding for me. Currently, the property is updated every time the contents of the TextBox changes.
My code is very simple, for example, here is my virtual machine:
public class ShellViewModel : PropertyChangeBase { private string _name; public string Name { get { return _name; } set { _name = value; NotifyOfPropertyChange(() => Name); } } }
And inside my view, I have a simple TextBox.
<TextBox x:Name="Name" />
How can I change it so that the Name property is updated only when the TextBox loses focus, and not every time the property changes?
Alex mcbride
source share