public ShoppingListRecipesPage(ShoppingListRecipesViewModel viewModel) { InitializeComponent(); BindingContext = viewModel; RecipeListView.ItemTemplate = new DataTemplate <RecipeCell>(); RecipeListView.SetBinding(ItemsView <Cell> .ItemsSourceProperty, nameof(viewModel.Recipes)); }
public MyRecipesPage(MyRecipesViewModel viewModel) { InitializeComponent(); BindingContext = viewModel; RecipeListView.ItemTemplate = new DataTemplate <RecipeCell>(); RecipeListView.SetBinding(ItemsView <Cell> .ItemsSourceProperty, nameof(viewModel.Recipes)); AddRecipeButton.Clicked += async(s, e) => await viewModel.AddRecipe(); }