I want to invoke a method every time a value from My.Settings
is changed. Something like:
Private Sub myValue_Changed(sender As Object, e As EventArgs) Handles myValue.Changed
(...)
End Sub
I know that, if I wanted to do it with a variable, I have to make it a class and set the event on it. But I canĀ“t do it with the value from My.Settings
.
Is there any way to do this?
As suggested in the comments on another answer, you can receive notification of a change in a setting via a
Binding
. Alternatively, you can do essentially what theBinding
class does yourself, as there's not really all that much to it, e.g.This code adds a changed handler to the property via a
PropertyDescriptor
, just as theBinding
class does.