Skip to content

Execute custom or standard Actions programmatically in your XAF ASP.NET Core Blazor application.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/xaf-how-to-execute-actions-in-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XAF - How to execute Actions programmatically

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.

image

Implementation Details

SimpleAction

mySimpleAction.DoExecute();

ParametrizedAction

myParametrizedAction.DoExecute("test value");

Make sure that the parameter type matches ParametrizedAction.ValueType. A string is used in this example.

SingleChoiceAction

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.

PopupWindowShowAction (Display a Dialog Window)

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.

Files to Review

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Execute custom or standard Actions programmatically in your XAF ASP.NET Core Blazor application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published