Is there any way to detected the application setting changes? please help me if there is a good way to detect the settings changes before saving it, i want to get all settings changes and notify the user that there are changes not saved. i did that manually but i want to know if there is a good way. thanks.
You can use the SettingChanging
event if you need to know before the change happens:
Properties.Settings.Default.SettingChanging += SettingChanging;
void SettingChanging(object sender, System.Configuration.SettingChangingEventArgs e)
{
// Do something
}
You can also get the new value by inspecting e.NewValue
.
Otherwise use PropertyChanged
:
Properties.Settings.Default.PropertyChanged += SettingChanged;
void SettingChanged(object sender, PropertyChangedEventArgs e)
{
// Do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With