Exemplo n.º 1
0
 public void ChangeCurrentActivity(ActivityModel newActivity, int nextIndex)
 {
     if (_activities.Count <= nextIndex)
     {
         _activities.Add(newActivity);
     }
     CurrentIndex = nextIndex;
     BackStackChanged?.Invoke();
 }
Exemplo n.º 2
0
        public bool RemoveActivityAt(int index)
        {
            if (index == CurrentIndex)
            {
                throw new ArgumentException("The current activity cannot be removed from the stack. ");
            }

            _activities.RemoveAt(index);
            if (index < CurrentIndex)
            {
                CurrentIndex--;
            }
            BackStackChanged?.Invoke();
            return(true);
        }
Exemplo n.º 3
0
 private void ActivityStackManagerOnBackStackChanged()
 {
     BackStackChanged?.Invoke(this, EventArgs.Empty);
 }