SSW Foursquare

Do you avoid "UI" in event names?

Last updated by Brook Jeynes [SSW] 8 months ago.See history

No "UI" in event names, the event raiser should be unaware of the UI in MVVM and user controls The handler of the event should then do something on the UI.

private void RaiseUIUpdateBidButtonsRed() { 
  if (UIUpdateBidButtonsRed != null) {
    UIUpdateBidButtonsRed();
  }
}

Bad example: Avoid "UI" in event names, an event is UI un-aware

private void RaiseSelectedLotUpdated() {
  if (SelectedLotUpdated != null) {
    SelectedLotUpdated();
  }
}

Good example: When receiving an update on the currently selected item, change the UI correspondingly (or even better: use MVVM and data binding)

We open source. Powered by GitHub