Hello,
I need that it execute a method async at the beginning in VM, how do it?
example:
public Command TextCommand { get; }
public ViewModel()
{
TextCommand = new Command(async () => await FunctionExecuteAsync());
TextCommand.Execute(null)
}
private async Task FunctionExecuteAsync()
{
//do something
}
Or:
public ViewModel()
{
Task.Run(async () => { await FunctionExecuteAsync(); });
}
private async Task FunctionExecuteAsync()
{
//do something
}
Wicht its the correct ?