Current filter:
                                You should refresh the page.
                                  • XAF v19.2 introduces a new ORM-agnostic IObjectSpaceAsync interface. XPObjectSpace implements this interface's asynchronous methods.

                                    The new API allows you to execute database operations and await their completion without blocking the application code execution. This allows your apps to feel responsive even when they connect to remote databases over slow networks.
                                    How It Works
                                    Asynchronous methods in XPObjectSpace wrap the corresponding methods in UnitOfWork. We also plan to implement such async functionality support in EFObjectSpace in future releases.

                                    If you develop ORM-agnostic modules that don't reference the DevExpress.ExpressApp.Xpo assembly, call these asynchronous methods via the IObjectSpaceAsync interface.
                                    Async WinForms UI Design Considerations
                                    You can't run synchronous operations in an XPO Session while it executes asynchronous code. This means that you shouldn't allow end-users to start data operations in the current window while asynchronous operations run in the window's object space.

                                    You can show overlay forms or disable certain Actions before you start asynchronous operations. Once an asynchronous operation is complete, close overlay forms and re-enable Actions.
                                    Supported Scenarios
                                    Download and start the attached project. Note that the app's first run involves test data creation, so you may experience a startup delay.

                                    Review the code in the AsyncDemoProject.Module.Win\Controllers folder and follow the steps below to learn about common usage scenarios:

                                    Scenario 1. Save Data Asynchronously.
                                    1. Navigate to the "Position" list view.
                                    2. Open the "Manager" record.
                                    3. Execute the "Update date" Action in the nested Contacts list view.
                                    4. Execute the "Async Save" Action. The view becomes disabled, yet you can navigate to other views, create new objects, etc. After changes are saved, you get a notification and can continue to use the "Position" detail view again. Use the "Async Save And Close" method to automatically close the view once your changes are saved.
                                    Scenario 2. Cancel Asynchronous Operations.
                                    1. Navigate to the "Position" list view.
                                    2. Open the "Manager" record.
                                    3. Execute the "Update date" Action in the nested Contacts list view.
                                    4. Execute the "Async Save" Action.
                                    5. While the operation is in progress, execute the "Close" Action and select "Yes" in the confirmation dialog. The operation will be canceled.
                                    Scenario 3. Handle Exceptions from Asynchronous Operations.
                                    1. Navigate to the "My Address" view.
                                    2. Execute the "Update date" Action.
                                    3. Execute the "Async Save" Action.
                                    4. A dialog with a message will be shown in response to the exception thrown from the asynchronous operation.

                                    Your Feedback Matters!
                                    We are looking forward to your feedback on this new API. Please describe the most important use-case scenarios where you will use async data operations in your apps. We hope to fine-tune this new API in 2020 and demonstrate new scenarios (for instance, how to asynchronously load data into a large ListView with XPCollection.LoadAsync).

                                    See Also
                                    FAQ: XPO Async/Await Method Support
                                    WinApplication.IsDelayedDetailViewDataLoadingEnabled - this existing option may help to load data into complex detail views asynchronously.

                                Show all comments
                                • Jose Javier Columbie 08.19.2019

                                  I just took the demo project for a spin and it is a beauty. Great Work

                                • Manuel Grundner [DevExpress MVP] 08.20.2019

                                  Awesome! Waiting for this for years! 

                                • Nate Laff 08.21.2019

                                  Demo is good. Did scenario 3 then went back to Position List view and got an ObjectDisposedException. Can't leave the position list view, will end up having to terminate the process.

                                  Cannot access a disposed object.
                                  Object name: 'DevExpress.ExpressApp.Xpo.XPObjectSpace'.

                                     at DevExpress.ExpressApp.BaseObjectSpace.CheckIsDisposed()
                                     at DevExpress.ExpressApp.Xpo.XPObjectSpace.GetKeyValueAsString(Object obj)
                                     at DevExpress.ExpressApp.ObjectView.CreateShortcutCore()
                                     at DevExpress.ExpressApp.ListView.CreateShortcutCore()
                                     at DevExpress.ExpressApp.View.CreateShortcut()
                                     at DevExpress.ExpressApp.SystemModule.ViewNavigationController.UpdateShortcutScrollPosition()
                                     at DevExpress.ExpressApp.SystemModule.ViewNavigationController.window_ViewChanging(Object sender, ViewChangingEventArgs e)
                                     at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
                                     at DevExpress.ExpressApp.Frame.OnViewChanging(View view, Frame sourceFrame, ViewChangingEventArgs args)
                                     at DevExpress.ExpressApp.Win.WinWindow.OnViewChanging(View view, Frame sourceFrame, ViewChangingEventArgs args)
                                     at DevExpress.ExpressApp.Frame.SetView(View view, Boolean updateControllers, Frame sourceFrame, Boolean disposeOldView)

                                • Uriah (DevExpress Support) 08.21.2019

                                  Hello Nate,

                                  I've created a separate ticket on your behalf (T808483: Core - The example provided in the T806131 article throws the ObjectDisposedException under certain circumstances). It has been placed in our processing queue and will be answered shortly.

                                • Christian Wirth 2 11.13.2019

                                  Hi There!

                                  Is there an example of how to use this with an ASP.NET XAF Application?

                                  We need to load non-persistent objects from a REST-endpoint utilizing the System.Net.Http.HttpClient. Specifically the GetJsonAsync method.
                                  What would be the recommended approach?


                                • Anatol (DevExpress Support) 11.13.2019

                                  Hello Christian,

                                  Since this article is related to XPO asynchronous capabilities for WinForms, I have created a separate ticket for your task: T832620: How to load non-persistent objects from a REST-endpoint. It has been placed in our processing queue and will be answered shortly.

                                0 Solutions

                                Creation Date Importance Sort by