Esempio n. 1
0
        /// <summary>
        /// "Navigate into" action.
        /// </summary>
        /// <returns>Corresponding (or default) content view model for node in "navigated" mode.</returns>
        public virtual IPanelContent NavigateInto()
        {
            var vm = new LocalFileSystemModuleFullVM(Model);

            vm.Refresh();
            return(vm);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LocalFileSystemModuleFullVM"/> class.
        /// </summary>
        /// <param name="another">Another <see cref="LocalFileSystemModuleFullVM"/> instance to copy data from.</param>
        protected LocalFileSystemModuleFullVM(LocalFileSystemModuleFullVM another)
            : base(another)
        {
            // Deep copy all childs
            var childsCopy = new ObservableCollection <IViewModel>();

            foreach (IViewModel child in another.childs)
            {
                childsCopy.Add((IViewModel)child.Clone());
            }

            childs = childsCopy;


            // Deep copy all selected childs
            var selectedChildsCopy = new ObservableCollection <IViewModel>();

            foreach (IViewModel child in another.selectedChilds)
            {
                selectedChildsCopy.Add((IViewModel)child.Clone());
            }

            selectedChilds   = selectedChildsCopy;
            currentItemIndex = another.CurrentItemIndex;
            Header           = (IPanelHeader)another.Header.Clone();
        }
Esempio n. 3
0
        /// <summary>
        /// "Navigate out" action.
        /// </summary>
        /// <returns>Corresponding (or default) content view model for parent node in "navigated" mode.</returns>
        public override IPanelContent NavigateOut()
        {
            var fullVM = new LocalFileSystemModuleFullVM(Model);

            fullVM.Refresh();

            for (int i = 0; i < fullVM.Childs.Count; i++)
            {
                IViewModel model = fullVM.Childs[i];

                if (model.AbsolutePath.StartsWith(AbsolutePath, StringComparison.InvariantCultureIgnoreCase))
                {
                    fullVM.CurrentItemIndex = i;
                }
            }

            return(fullVM);
        }