Ok, here is a complete solution which roughly corresponds to commonly recommended best practices... I suggest that you read an article about the basics of delegates and events, that will help you a lot.
class MyClass {
private string someValue;
public string SomeValue {
get { return someValue; }
set {
if (value == someValue) return;
someValue = value;
OnSomeValueChanged();
}
}
public event EventHandler SomeValueChanged;
private void OnSomeValueChanged() {
if (SomeValueChanged != null) SomeValueChanged(this, EventArgs.Empty);
}
}
You may want to use a different delegate type than
EventHandler
and create a custom
EventArgs
class... The example I gave you is just a start.