public virtual void SetDefaults() { // The latching and explicit call to ElementValueChanged() is to make sure // elements like TextBox fire change events correctly on this method var changed = false; WithinLatch( delegate { object lastValue = LastChosenValues.Retrieve(Driver); if (lastValue != null) { changed = true; ResetControl((PROPERTYTYPE)lastValue); } }); if (changed && IsBound) { ElementValueChanged(); } }
private void StoreValue() { object currentValue = GetValueFromControl(); LastChosenValues.Store(Driver, currentValue); }