using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Prism.Navigation;

namespace CafeTerrace.ViewModels
{
    public class HomePageViewModel : ViewModelBase
    {
        public ICommand ProfileButtonCommand { get; set; }
        public ICommand BuyBagButtonCommand { get; set; }
        public ICommand FoodItemCommand { get; set; }
        public bool IsOpenBuyBag { get; set; } = false;
        public HomePageViewModel(INavigationService navigationService):base(navigationService)
        {

        }

        public override void InitializeCommand()
        {
            base.InitializeCommand();
            ProfileButtonCommand = new DelegateCommand(() =>
            {
                NavigationService.NavigateAsync("ProfilePage");
            });
            BuyBagButtonCommand = new DelegateCommand(() =>
            {
                if (!IsOpenBuyBag)
                    IsOpenBuyBag = true;
                else
                    IsOpenBuyBag = false;
            });
            FoodItemCommand = new DelegateCommand(() =>
            {
                NavigationService.NavigateAsync("FoodPage");
            });
        }

    }
}
