Whilst programming Java GUis I made heavy use of the Action class. The instantiated action class was passed to numerous button or menu item constructors so that you only had to code the logic in one place.
Each time you clicked on a button/icon/menuitem associated with the action the actionPerformed method would fire and execute the code.
This was a great time saver and allowed me to write the logic only once.
Questions:
- Is there a similar class in C# or .NET framework?
- Have I got this all wrong and there is a different way to have one set of logic called from multiple buttons/icons/menuitems?
.Net uses events heavily and you can do something like this if you have common functionality.
and