My program is designed to change and save user settings. The program consists of many usercontrols. I need to show message to the user to save the settings before closing the application when it was produced at least one unsaved changing.
There are too many controls and it will be inefficiently to define an event for each control.I don’t sure that it is only one way to solve my problem. Any advice please..
My program is designed to change and save user settings. The program consists of
Share
There aren’t really any options that can do what you are asking. If your controls are bound to an object, you can use the object to see if it has any changes, assuming the object implements INotifyPropertyChanged.
Another method would be be programatically add a handler (for the “changing” event such as
TextChangedfor a TextBox) to each control that maps to a single sub that sets a flag.