Esempio n. 1
0
 public OpenFolderDialogView(Window owner, OpenFolderDialogContext context) : base(owner)
 {
     InitializeComponent();
     _context    = context;
     DataContext = _context.ViewModel;
     _context.ListDirectory();
 }
Esempio n. 2
0
        private void OnDirectoryOpenButtonClick(object sender, RoutedEventArgs e)
        {
            var dialogContext = new OpenFolderDialogContext(
                new OpenFolderDialogViewModel(),
                new DirectorySearchComponent());

            dialogContext.ViewModel.Title     = "Bulk Rename | Open folder";
            dialogContext.ViewModel.Directory = _context.ViewModel.Path;
            var dialog = new OpenFolderDialogView(this, dialogContext);
            var result = dialog.ShowDialog();

            if (result.HasValue && result.Value)
            {
                _context.ViewModel.Path = dialogContext.ViewModel.Directory;
                _context.ListFiles();
            }
        }