XAML-based applications - Event Naming Conventions for C#

Posted by user118190 on Stack Overflow See other posts from Stack Overflow or by user118190
Published on 2010-06-14T18:59:16Z Indexed on 2010/06/14 19:02 UTC
Read the original article Hit count: 201

Filed under:
|

For event handling, I am starting to see many coders doing this:

XButton.Click += OnXButtonClicked()
...
void OnXButtonClicked()
{ ... }

Where did this On_ convention come from? It just doesn't feel right in terms of methods.

I am starting to see this as well and am wondering what others thought:

XButton.Click += HandleXButtonClick()
...
void HandleXButtonClick()
{ ... }

When using intellisense, Visual Studio handles these like so:

XButton.Click += XButton_Click;
...
void XButton_Click(object sender, RoutedEventArgs e)
{ ... }

I am seeking some advice on these naming conventions and would greatly appreciate some advice.

© Stack Overflow or respective owner

Related posts about c#

Related posts about xaml