Horje
c# async constructor Code Example
c# async constructor
public class ViewModel       
{       
    public ObservableCollection<TData> Data { get; set; }       

    //static async method that behave like a constructor       
    async public static Task<ViewModel> BuildViewModelAsync()  
    {       
        ObservableCollection<TData> tmpData = await GetDataTask();  
        return new ViewModel(tmpData);
    }       

    // private constructor called by the async method
    private ViewModel(ObservableCollection<TData> Data)
    {
        this.Data = Data;   
    }
}  




Csharp

Related
how to disable device guard or credential guard vmware Code Example how to disable device guard or credential guard vmware Code Example
c# string console readline array Code Example c# string console readline array Code Example
c# int to string date conversion Code Example c# int to string date conversion Code Example
check if two timespans intersect c# Code Example check if two timespans intersect c# Code Example
C# System.nanoTime Code Example C# System.nanoTime Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13