Closed yoshiask closed 2 years ago
@Arlodotexe Would it also help to add a method to reset all settings (clear _runtimeStorage
)? Maybe that should be a separate PR, but it's still under the umbrella of "resetting values"
@Arlodotexe Would it also help to add a method to reset all settings (clear
_runtimeStorage
)? Maybe that should be a separate PR, but it's still under the umbrella of "resetting values"
@yoshiask Sure, we can make that part of this PR if you'd like, otherwise this looks good to me. For naming, I'm thinking something like ResetAllSettings()
?
Yup, that name sounds good to me
Background
This PR introduces two options for resetting a setting to its default value. Closes #3
Motivation
Resetting could previously be achieved by setting the property to
null
, but this did not firePropertyChanged
and could be unintuitive for consumers.Proposal
SetSetting<T>(T value, string key)
always invoke thePropertyChanged
eventResetSetting<T>(string key)
to allow explicit resetting of properties