This example show the various ways you can call async operations in XAF actions and the behaviour of the UI when doing so.
Executes two asynchronous tasks sequentially and displays their combined results in a success message.
- The operations in the task list might take longer to execute than the time the method takes to finish
- In this case the method will finish, the U.I will continue be responsive
- but the tasks will still be running in the background and there is not right way to return to the main thread
Executes a series of asynchronous tasks and updates the Result
property of the TestObject
instance. Displays a success message upon completion.
- The operations in the task list might take longer to execute than the time the method takes to finish
- In this case the method will finish, the U.I will continue be responsive
- but the tasks will still be running in the background and there is not right way to return to the main thread
Executes a series of tasks synchronously, blocking the UI thread. Displays the results in a success message.
- The U.I will be blocked and so the main thread will be blocked so your application is frozen forever
Asynchronous task that simulates a delay and returns a result string.
Asynchronous task that simulates a delay and returns a result string.
Returns a list of asynchronous tasks to be executed.
Queues a list of tasks to run in the background and sets up progress reporting and completion handling.
Handles the completion of all tasks. Intended to run on the UI thread.
Reports the progress of task execution to the U.I thread. Displays a status message and logs the result.
Called when the controller is activated. Can be used to perform various tasks depending on the target view.
Called when the controller is deactivated. Unsubscribes from events and releases resources.
Called when the view controls are created. Can be used to access and customize the target view control.
Returns the current instance of TestObject
from the view.
Commits changes to the ObjectSpace
if it is modified.
Shows a loading indicator while the action is executing. Calls the base method to execute a series of asynchronous tasks.
Shows a loading indicator while the action is executing. Calls the base method to execute two asynchronous tasks sequentially.
Shows a loading indicator while the action is executing. Calls the base method to queue a list of tasks to run in the background.
Reports the progress of task execution to the UI thread. Calls the base method to display a status message and log the result.
Handles the completion of all tasks. Calls the base method to run on the UI thread and hides the loading indicator.