Catel.MVVM.ViewModelBase.InitializeAsync C# (CSharp) Method

InitializeAsync() protected method

Initializes the view model. Normally the initialization is done in the constructor, but sometimes this must be delayed to a state where the associated UI element (user control, window, ...) is actually loaded. This method is called as soon as the associated UI element is loaded.
It's not recommended to implement the initialization of properties in this method. The initialization of properties should be done in the constructor. This method should be used to start the retrieval of data from a web service or something similar. During unit tests, it is recommended to manually call this method because there is no external container calling this method.
protected InitializeAsync ( ) : Task
return Task
        protected virtual async Task InitializeAsync()
        {
            // Note: should be converted to a sync method in v5
            await Initialize();
        }