public ShoppingListRecipesPage(ShoppingListRecipesViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = viewModel;

            RecipeListView.ItemTemplate = new DataTemplate <RecipeCell>();
            RecipeListView.SetBinding(ItemsView <Cell> .ItemsSourceProperty, nameof(viewModel.Recipes));
        }
Esempio n. 2
0
        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();
        }