示例#1
0
 public IDisposable BindOpenFolderCommand()
 {
     _model.OpenFolderCommand = ReactiveCommand.CreateFromObservable(() => {
         var d = 0;
         return(_dialogManager.OpenFolder("c:\\Temp"));
     }, null, RxApp.MainThreadScheduler);
     return(_model.OpenFolderCommand.SubscribeWithLog(folder => {
         _model.Title = "selectd folder " + folder;
     }));
 }
示例#2
0
        private IDisposable BindCommands(IDialogManager dialogManager)
        {
            OpenFolderCommand = ReactiveCommand.CreateFromObservable(
                () => dialogManager.OpenFolder(null), null, RxApp.MainThreadScheduler);

            return(OpenFolderCommand
                   .SubscribeOn(RxApp.TaskpoolScheduler)
                   .ObserveOn(RxApp.MainThreadScheduler)
                   .SubscribeWithLog(directory =>
            {
                var path = Path.GetFullPath(directory);

                if (Roots.All(r => r != path))
                {
                    Roots.Add(path);
                }
            }));
        }