Hi,
so far I always implemented Commands as public properties and initialized them in my Constructor like this:
public class MainMenuPageModel : FreshBasePageModel
{
public MainMenuPageModel()
{
OpenRecipesCommand = new Command(async () => await CoreMethods.PushPageModel<RecipesMainPageModel>());
}
public Command OpenRecipesCommand { get; private set; }
}
No I stumbled upon this solution:
public Command AddContact {
get {
return new Command (async () => {
await CoreMethods.PushPageModel<ContactPageModel> ();
});
}
}
Is there any advantages/disadvantages in this solutions?
Cheers
Thomas