using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Telerik.Windows.Controls;

namespace WpfApp123
{
    public class MainWindowViewModel : ViewModelBase
    {
        public ObservableCollection<NavigationModel> Navigations
        {
            get
            {
                return new ObservableCollection<NavigationModel>
                {
                    new NavigationModel { IconGlyph = "&#xe90a", Title = "View", Code ="view" },
                    new NavigationModel
                    {
                        IconGlyph = "&#xe90b", Title = "A View", Code="a_view", IsSelectable = false, IsEnabled = false,
                        SubItems = new ObservableCollection<NavigationModel>
                        {
                            new NavigationModel { IconGlyph = "&#xe90c", Title = "A - 1", Code="a_1", },
                            new NavigationModel { IconGlyph = "&#xe90d", Title = "A - 2", Code="a_2", },
                        },
                    },
                    new NavigationModel
                    {
                        IconGlyph = "&#xe90e", Title = "B View", Code="b_view", IsSelectable = false, IsEnabled = IsBState,
                        SubItems = new ObservableCollection<NavigationModel>
                        {
                            new NavigationModel { IconGlyph = "&#xe90f", Title = "B - 1", Code="b_1", },
                            new NavigationModel { IconGlyph = "&#xe910", Title = "B - 2", Code="b_2", },
                        },
                    },
                    new NavigationModel { IconGlyph = "&#xe911", Title = "C View", Code ="c_view" },
                };
            }
        }

        private bool isAState = true;
        public bool IsAState
        {
            get => isAState;
            set
            {
                isAState = value;
                OnPropertyChanged("IsAState");
            }
        }

        private bool isBState = false;
        public bool IsBState
        {
            get => isBState;
            set
            {
                isBState = value;
                OnPropertyChanged("IsBState");
            }
        }


        public ICommand ATrueCommand { get => new DelegateCommand(x => IsAState = true ); }
        public ICommand AFalseCommand { get => new DelegateCommand(x => IsAState = false); }


        public ICommand BTrueCommand { get => new DelegateCommand(x => IsAState = true); }
        public ICommand BFalseCommand { get => new DelegateCommand(x => IsAState = false); }

    }
}
