ApplicationSettings automatically persist and bind property values for a component under the following circumstances:
- The component implements IBindableComponent.
- The component has either:
- A PropertyChanged event for the specific property (e.g., TextChanged, ValueChanged, etc…)
- or the component implements INotifyPropertyChanged.
Since all controls inherit from System.Windows.Forms.Control and Control implements IBindableComponent for controls you really only need to worry about the 2nd requirement. If the control has a property changed event for the specific property then it will probably be automatically persisted when connected to an ApplicationSetting property.
No comments:
Post a Comment