Is there .NET equivalent to Delphi's ActionList?

别来无恙 提交于 2019-11-29 20:10:38

问题


We're currently using Delphi 5 and Delphi 2005 for development, and investigate of going the .NET route via Delphi Prism.

Is there a .NET equivalent to Delphi's ActionList?

For those not familiar with ActionList, it's a component that contains a collection of actions that we create, e.g. Save, Refresh, Load, etc. Each action can have a caption, image, enable/disable assign to it. After that, you can assign a button to an action, and the button will inherit the action's caption, image, etc, and if you UI has the save action available as both a menu item and a button, they can both use the same action.


回答1:


WinForms do not have such a thing build in, but WPF does with its commands. See http://www.microsoft.com/belux/msdn/nl/community/columns/jdruyts/wpf_commandpattern.mspx




回答2:


You may also take a look at Actions for .NET WinForms. Among other things, it allows to categorize actions in a Delphi-like way, and has an option to execute and/or update them asynchronously.




回答3:


Yes, there is: Crad's Actions.

That is a CodeProject page describing, and hosting the original source code. The code link on the original author's page is broken.

It's a shame Microsoft doesn't adopt them.




来源:https://stackoverflow.com/questions/489376/is-there-net-equivalent-to-delphis-actionlist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!