protected virtual void OnValueChanged(SomeEventArgs e) { if (Value_Changed != null) { Value_Changed(this, e); } }
void HandleChange(object sender /*this will be the instance that raised the event*/, SomeEventArgs e) { //BTW: this.watcher == sender; //the same instance form.DisplayNotification(this.watcher.GetData()); }
private void OnCommandManagerRequerySuggested(object sender, SomeEventArgs e) { InvalidateCommands(); }
// this is what your button calls when clicked public void SaveAsync(object sender, SomeEventArgs args) { // the service does the actual work _service.SaveAsync() }
// Some event happens that we want to notify subscribers about void EventHandler(object sender, SomeEventArgs e) { UsefulInfo info = CreateUsefulInfo(e); _observable.OnNext(info); }
private MyEventArgs ConvertEventArgs(SomeEventArgs args) { // the magic goes here... }
private void HandleSomeClassSomeEvent(object sender, SomeEventArgs args) { OnSomeEvent(ConvertEventArgs(args)); }