Is it possible to set the root folder?

Jan 13, 2014 at 7:21 PM
Is it possible to add a property "RootFolder" so that I can let File Explorer only shows things only in that folder and it's sub-folders?
Coordinator
Feb 21, 2014 at 2:08 PM
Hello

Sorry for late reply, you can change root folder by
setting ExplorerViewModel.RootModels property.

It's in IEntryModel so you have to parse one using
IProfile.ParseAsync(path).

There are 4 Profiles available at this moment,
FileSystemInfo, DirectoryInfoEx, SkyDrive and
GoogleDrive.

As my computer is offline right now, please check
the latest source for more info.

Regards
Joseph Leung
Feb 22, 2014 at 5:47 AM
thanks for the answer. I downloaded your latest source code and found I couldn't compile the FileExplorer3. The error message is below. I guess it's still in progress...

C:\Users...\Documents\Visual Studio 2012\Projects\Other\FileExplorer3\TestSkyDrive2\TestSkyDrive2.csproj : error : The project file could not be loaded. Could not find a part of the path 'C:\Users...\Documents\Visual Studio 2012\Projects\Other\FileExplorer3\TestSkyDrive2\TestSkyDrive2.csproj'.
C:\Users...\Documents\Visual Studio 2012\Projects\Other\FileExplorer3\TestSkyDrive2\TestSkyDrive2.csproj
Coordinator
Feb 23, 2014 at 9:23 AM
Hello

I forgot to remove the test project from the solution (FileExplorer3), please remove them from your Solution Explorer manually.

Regards
Joseph Leung
Mar 2, 2014 at 3:31 PM
Is there an easy example for how to use the FileExplorer3 lib?
I used the following code and it showed only an empty explorer.
<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525"
    xmlns:vw="clr-namespace:FileExplorer.Views;assembly=FileExplorer3">
    
    <Grid>
        <vw:ExplorerView />     
    </Grid>
</Window>
Coordinator
Mar 2, 2014 at 4:38 PM
Edited Mar 2, 2014 at 4:54 PM
Hello

You have to setup an ExplorerViewModel (_explorer), e.g.
if (_profileEx == null) 
      _profileEx = new FileSystemInfoExProfile(_events, _windowManager);
//Desktop as root directory
var root = _profileEx.ParseAsync(System.IO.DirectoryInfoEx.DesktopDirectory.FullName).Result;
var viewModel = new ExplorerViewModel(_events, _windowManager, root, /* you can assign more root dir here */));
var view = new ExplorerView();
If you want to initialize ExplorerView directly, please check the code in MdiWindow.xaml.cs, use the Caliburn.Micro.Bind.SetModel(view, _explorer) method.

If you develop using Caliburn.Micro framework, you can use windowManager.ShowWindow(_explorer) method directly.

Regards
Joseph Leung