using Avalonia.Controls;
using ReactiveUI;
using System;
using TourSK2.Models;
using TourSK2.Views;

namespace TourSK2.ViewModels
{
    public class MainWindowViewModel : ViewModelBase
    {
        public static UpSkakunovContext connect = new UpSkakunovContext();

        UserControl us = new Views.ListMenu();

        public UserControl US
        {
            get => us;
            set => this.RaiseAndSetIfChanged(ref us, value);
        }

        PageToursViewModel _tourVM = new PageToursViewModel();

        public PageToursViewModel TourVM
        {
            get => _tourVM;
            set => _tourVM = value;
        }

        PageHotelsViewModel hotelVM = new PageHotelsViewModel();

        public PageHotelsViewModel HotelVM
        {
            get => hotelVM;
            set => hotelVM = value;
        }

        PageAddRedactViewModel _addredactVM = new PageAddRedactViewModel();
        public PageAddRedactViewModel AddRedactVM
        {
            get => _addredactVM;
            set => _addredactVM = value;
        }

        public void ChangePageToHotels()
        {
            US = new ListHotels();
        }
        public void ChangePageToTours()
        {
            US = new ListTours();
        }

        public void ToAddRed(int id)
        {
            AddRedactVM = new PageAddRedactViewModel(id);
            US = new ListAddRedact();
        }

        public void ToAddRedNo()
        {
            US = new ListAddRedact();
        }
    }
}