public OpenFolderDialogView(Window owner, OpenFolderDialogContext context) : base(owner) { InitializeComponent(); _context = context; DataContext = _context.ViewModel; _context.ListDirectory(); }
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(); } }