Exemple #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 fullVM = new FolderFullVM(Model)
            {
                AbsolutePath = Folder.FullName
            };

            fullVM.Refresh();

            return(fullVM);
        }
Exemple #2
0
        /// <summary>
        /// "Navigate out" action.
        /// </summary>
        /// <returns>Corresponding (or default) content view model for parent node in "navigated" mode.</returns>
        public override IPanelContent NavigateOut()
        {
            if (Folder.Parent != null && Folder.Parent.Parent != null)
            {
                var fullVM = new FolderFullVM(Model)
                {
                    AbsolutePath = Folder.Parent.FullName
                };
                fullVM.Refresh();

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

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

                return(fullVM);
            }
            else
            {
                var fullVM = new DriveFullVM(Model)
                {
                    AbsolutePath = Folder.FullName
                };
                fullVM.Refresh();

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

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

                return(fullVM);
            }
        }