public void ChangeFileSystem(FileSystemBase fileSystem) { fileSystem1 = fileSystem.GetCopy(); fileSystem2 = fileSystem; fileSystem3 = fileSystem.GetCopy(); //set up binding for second column Binding bind2 = new Binding("Items");//bind to ListBox bind2.Source = FileSystem; lbContent2.SetBinding(ListBox.ItemsSourceProperty, bind2); //loading files into first column lbContent1.ItemsSource = null;//clear items if (!FileSystem.IsRootPath(FileSystem.CurrentPlace.FullName)) { fileSystem1.LoadDirectory(PathExt.GetDirectoryName(FileSystem.CurrentPlace.FullName, FileSystem.IsWindowsFileSystem)); lbContent1.ItemsSource = fileSystem1.Items; } //third column is loaded by selecting items in second //save in history HistoryGlobal.AddItem(FileSystem.CurrentPlace); history.AddItem(FileSystem.CurrentPlace, false); dirChanged = true; //SetFocusOnContent(); OnPropertyChanged("FileSystem"); }
public void LoadDir(string dir, bool saveInHistory) { //loading files into second column FileSystem.LoadDirectory(dir); dirChanged = true; //loading files into first column lbContent1.ItemsSource = null;//clear items if (!FileSystem.IsRootPath(FileSystem.CurrentPlace.FullName)) { fileSystem1.LoadDirectory(PathExt.GetDirectoryName(FileSystem.CurrentPlace.FullName, FileSystem.IsWindowsFileSystem)); lbContent1.ItemsSource = fileSystem1.Items; } //save in history if (saveInHistory) { HistoryGlobal.AddItem(FileSystem.CurrentPlace); history.AddItem(FileSystem.CurrentPlace, false); } }