Ejemplo n.º 1
0
        public bool ChangeOrder(FaderItemViewModel item, OrderDirection dir)
        {
            int currentIndex = GetIndexOfItem(item);

            switch (dir)
            {
            case OrderDirection.Up:
                if (currentIndex > 0)
                {
                    Colors.Move(currentIndex, currentIndex - 1);
                }
                else
                {
                    return(false);
                }
                break;

            case OrderDirection.Down:
                if (currentIndex < Colors.Count - 1)
                {
                    Colors.Move(currentIndex, currentIndex + 1);
                }
                else
                {
                    return(false);
                }
                break;
            }

            RaisePropertyChanged(() => Colors);
            UpdateItems();
            return(true);
        }
Ejemplo n.º 2
0
//		private MvxCommand _removeCommand;
//		public IMvxCommand RemoveCommand{get{ return _removeCommand;}}

        public void Remove(FaderItemViewModel item)
        {
            Debug.WriteLine("remove " + item.Item);
            Colors.Remove(item);
            RaisePropertyChanged(() => Colors);
            UpdateItems();
        }
Ejemplo n.º 3
0
//		private MvxCommand _addColorCommand;
//		public IMvxCommand AddColorCommand{get{ return _addColorCommand;}}

        public void AddColor(Color color)
        {
            FaderItemViewModel item = new FaderItemViewModel(color, this);

            Colors.Add(item);
            RaisePropertyChanged(() => Colors);
            UpdateItems();
        }
Ejemplo n.º 4
0
 public int GetIndexOfItem(FaderItemViewModel item)
 {
     return(Colors.IndexOf(item));
 }