using Earthblend.Nts.Common;
using Earthblend.Tts.Common.Core;
using Earthblend.Tts.Common.Core.Enumerations;
using System;
using System.Collections.ObjectModel;
using System.Windows.Input;
using System.Windows.Media;

namespace Earthblend.Tts.Common.Core.Members
{
    public class RibbonItem : CustomBindableBase
    {
        #region Private Variables

        private String _header = "";
        private ICommand _command = null;
        private Object _commandParameter = null;
        private ObservableCollection<RibbonItem> _items = new ObservableCollection<RibbonItem>();
        private Double _width = 75;
        private Double _height = 100;
        private ImageSource _selectedImageSource = null;
        private ImageSource _defaultImageSource = null;
        private ImageSource _smallImageSource = null;
        private Boolean _isSelected = false;
        private RibbonItem _parentRibbonItem = null;
        private ItemType _ribbonItemType = ItemType.Button;

        #endregion

        #region Public Clr Properties

        public ItemType RibbonItemType { get { return _ribbonItemType; } set { SetProperty(ref _ribbonItemType, value); } }

        public Boolean IsSelected { get { return _isSelected; } set { SetProperty(ref _isSelected, value); NotifyPropertyChanged("ImageSource"); } }

        public String Header { get { return _header; } set { SetProperty(ref _header, value); } }
        public ICommand Command { get { return _command; } set { SetProperty(ref _command, value); } }
        public Object CommandParameter { get { return _commandParameter; } set { SetProperty(ref _commandParameter, value); } }
        public Double Width { get { return _width; } set { SetProperty(ref _width, value); } }
        public Double Height { get { return _height; } set { SetProperty(ref _height, value); } }
        public ImageSource ImageSource { get { if (IsSelected) return _selectedImageSource; else return _defaultImageSource; } }
        public ImageSource SelectedImageSource { get { return _selectedImageSource; } set { SetProperty(ref _selectedImageSource, value); NotifyPropertyChanged("ImageSource"); } }
        public ImageSource DefaultImageSource { get { return _defaultImageSource; } set { SetProperty(ref _defaultImageSource, value); NotifyPropertyChanged("ImageSource"); } }
        public ImageSource SmallImageSource { get { return _smallImageSource; } set { SetProperty(ref _smallImageSource, value); } }

        public ObservableCollection<RibbonItem> Items
        {
            get { return _items; }
            set { SetProperty(ref _items, value); }
        }

        public RibbonItem ParentRibbonItem
        {
            get { return _parentRibbonItem; }
            set { SetProperty(ref _parentRibbonItem, value); }
        }

        #endregion
    }
}