public SearchResultsPaneViewModel(JadeCore.Search.ISearchController controller) { Title = "Search Results"; ContentId = "SearchResultsToolPane"; _controller = controller; _searches = new ObservableCollection<SearchViewModel>(); ((INotifyCollectionChanged)_controller.Searches).CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { OnNewSearch((ISearch)e.NewItems[0]); } }; _currentFileTextSearch = new CurrentFileTextSearchViewModel(_controller); JadeCore.Services.Provider.EditorController.ActiveDocumentChanged += delegate { OnPropertyChanged("CanPerformSearchInCurrentFile"); }; JadeCore.Services.Provider.MainWindow.CommandBindings.Add(new CommandBinding(JadeCore.Commands.SearchCurrentFile, delegate(object target, ExecutedRoutedEventArgs args) { RaiseStartNewCurrentFileSearch(); args.Handled = true; }, delegate(object target, CanExecuteRoutedEventArgs args) { args.CanExecute = CanPerformSearchInCurrentFile; args.Handled = true; })); }
public CurrentFileTextSearchViewModel(JadeCore.Search.ISearchController controller) { _editorController = JadeCore.Services.Provider.EditorController; _controller = controller; }