using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Moshaverino.Views.Interoduce;
using Prism.Navigation;
using Xamarin.Forms;

namespace Moshaverino.ViewModels
{
    public class IntroducePageViewModel : ViewModelBase
    {
        public List<ContentView> Interduces { get; set; }
        private int _position = 0;
        public int Position
        {
            get { return _position; }
            set { SetProperty(ref _position, value); }
        }
        public IntroducePageViewModel(INavigationService navigationService):base(navigationService)
        {
            var inA = new InteroduceA();
            inA.NextClicked += ((sender, e) => { Position++; });
            var inB = new InteroduceB();
            inB.NextClicked += ((sender, e) => { Position++; });
            inB.BackClicked += ((sender, e) => { Position--; });
            var inC = new InteroduceC();
            inC.BackClicked += ((sender, e) => { Position--; });
            inC.NextClicked += ((sender, e) => { navigationService.NavigateAsync("ActivePhonePage"); });
            Interduces = new List<ContentView>
            {
                inA,
                inB,
                inC
            };
        }
    }
}
