using FSI.Lib.MVVM;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Input;

namespace FSI.Lib.Guis.WebRadio
{
    public class ViewModel : MVVM.ViewModelBase
    {
        private ICommand _cmdPlay;
        private ICommand _cmdStop;
        
        public ViewModel()
        {
            Datas = new ObservableCollection<IInterface>();

            _cmdPlay = new RelayCommand<object>(ExecutePlay, CanExecutePlay);
            _cmdStop = new RelayCommand<object>(ExecuteStop, CanExecuteStop);
        }
        public ObservableCollection<IInterface> Datas { get; set; }

        public IInterface SelectedData { get; set; }

        public string StatusTxt { get; set; }

        public void Load(IEnumerable<IInterface> datas)
        {
            Datas = new ObservableCollection<IInterface>(datas.Cast<IInterface>());
        }

        private bool CanExecutePlay(object obj)
        {
            return true;
        }

        private void ExecutePlay(object obj)
        {
            
        }

        public ICommand CmdPlay
        {
            get { return _cmdPlay; }
            set => _cmdPlay = value;
        }

        private bool CanExecuteStop(object obj)
        {
            return true;
        }

        private void ExecuteStop(object obj)
        {
          
        }

        public ICommand CmdStop
        {
            get { return _cmdStop; }
            set => _cmdStop = value;
        }

     

    }

}
