I want to maintain a stack navigation in which we store path of directories.but in my code im able to store only current path and if i change my directories i lost my old stack. for ex if i chande my directory from "My computer to Dowloads " then i am not able to keep path for my computer
here is my sample code private void btnBack_Click(object sender, RoutedEventArgs e) { //string Tree1; IList childFileList = new List(); // string Path = (sender as Button).ToString(); IList childDirList = new List(); if (stack.Count > 1) { stack.Pop(); stackNext.Push(stack.Peek()); string Path = stack.Peek().ToString(); isback = true;
//code for create button by sending drive info //DirInfo dnr = new DirInfo(); //dnr.Path = Path; //vm.createButton(dnr);
vm.createB(Path);
if (Path == "My Computer") {
childDirList = (from rd in FileSystemExplorerService.GetRootDirectories1(vm.CurrentDirectory.Path) select new DirInfo(rd)).ToList(); } else if (Path == "My Favourite" || Path == "My Library") {
Replies
Know the answer? Post it — somebody with the same question will find it here.