This example shows how to trigger the code inside Execute
event handlers of custom or standard XAF Actions. For example, you can programmatically invoke an Action that shows a View or runs code in the background.
NOTE We do not recommend this approach. Refactor your Action's event handlers and extract the code into separate methods. Call these separate methods directly without triggering UI-related Action code.
mySimpleAction.DoExecute();
myParametrizedAction.DoExecute("test value");
Make sure that the parameter type matches ParametrizedAction.ValueType
. A string is used in this example.
mySingleChoiceAction.DoExecute(mySingleChoiceAction.Items[0]);
Make sure you pass a parameter that is a valid item from SingleChoiceAction.Items
. This example passes the first item in the collection.
We do not provide public API to execute a PopupWindowShowAction. Use the ShowViewStrategyBase.ShowViewInPopupWindow(View, Action, Action, String, String) method to show a View in a pop-up window.
(you will be redirected to DevExpress.com to submit your response)