Exemple #1
0
        /// <summary>
        /// Reset selection.
        /// </summary>
        protected override void OnReset()
        {
            if (this.selectedItemViewModel != null)
            {
                this.selectedItemViewModel.IsSelected = false;
            }

            this.clickedItemViewModel  = null;
            this.selectedItemViewModel = null;

            this.contextMenu = null;
            this.contextMenu = this.defaultContextMenu;

            if (rootViewModels != null)
            {
                rootViewModels.Clear();
            }
            rootViewModels = null;

            if (rootTreeViewItemViewModelStorage != null)
            {
                rootTreeViewItemViewModelStorage.Dispose();
            }
            rootTreeViewItemViewModelStorage = null;

            base.OnReset();
        }
        private void ResetVM()
        {
            SelectedPath = "";

            if (rootViewModels != null)
            {
                rootViewModels.Clear();
            }
            rootViewModels = null;

            if (rootTreeViewItemViewModelStorage != null)
            {
                rootTreeViewItemViewModelStorage.Dispose();
            }
            rootTreeViewItemViewModelStorage = null;

            OnPropertyChanged("RootViewModels");
        }