예제 #1
0
        private void ActiveViews_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                ActiveViews.Add(e.NewItems[0].ToString());
                break;

            case NotifyCollectionChangedAction.Remove:
                ActiveViews.Remove(e.OldItems[0].ToString());
                break;

            case NotifyCollectionChangedAction.Replace:
                break;

            case NotifyCollectionChangedAction.Move:
                break;

            case NotifyCollectionChangedAction.Reset:
                ActiveViews.Clear();
                foreach (var view in region.ActiveViews)
                {
                    ActiveViews.Add(view.ToString());
                }
                break;

            default:
                break;
            }

            RemoveActiveViewCommand.RaiseCanExecuteChanged();

            SelectedViewName = ActiveViews.FirstOrDefault();
        }