public void ShowDialog()
 {
     if (FolderBrowserDialogService.ShowDialog())
     {
         ResultPath = FolderBrowserDialogService.ResultPath;
     }
 }
示例#2
0
 public PrimaryFiles()
 {
     InitializeComponent();
     if (!mvvmContextPrimaryFiles.IsDesignMode)
     {
         InitializeBindings();
         mvvmContextPrimaryFiles.RegisterService(
             FolderBrowserDialogService.Create(FolderBrowserStyle.SkinnableWide));
         MVVMContext.RegisterFlyoutMessageBoxService();
     }
 }
示例#3
0
        void InitializeNavigation()
        {
            mvvmContext.RegisterService(DocumentManagerService.Create(tabFormControl));
            mvvmContext.RegisterService(FolderBrowserDialogService.Create(this, new FolderBrowserDialogServiceOptions()
            {
                Description = "New Folder"
            }));
            //
            var fluent = mvvmContext.OfType <MainViewModel>();

            fluent.BindCommand(tabFormControl.AddPageButton, x => x.NewFolder());
            fluent.WithEvent(this, "Load")
            .EventToCommand(x => x.OnLoad());
            fluent.WithEvent(this, "Closed")
            .EventToCommand(x => x.OnClosed());
        }
示例#4
0
        public void OpenOrCreate(Folder folder)
        {
            if (folder.IsNew())
            {
                if (FolderBrowserDialogService.ShowDialog())
                {
                    DataModel.OnNewFolder(FolderBrowserDialogService.ResultPath);
                }
                return;
            }
            IDocument document = DocumentManagerService.FindDocumentByIdOrCreate(folder.Path,
                                                                                 svc => svc.CreateDocument("FolderView", folder, this.GetParentViewModel <MainViewModel>()));

            document.Id = folder.Path;
            document.Show();
            DataModel.OnFolderOpen(folder);
        }