void ExecuteFind(object sender, ExecutedRoutedEventArgs e) { if (panel == null || panel.IsClosed) { panel = new SearchPanel(); panel.Attach(TextArea); } panel.SearchPattern = TextArea.Selection.GetText(); Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate { panel.Reactivate(); }); }
void ExecuteFind(object sender, ExecutedRoutedEventArgs e) { panel.Open(); if (!(TextArea.Selection.IsEmpty || TextArea.Selection.IsMultiline)) { panel.SearchPattern = TextArea.Selection.GetText(); } Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate { panel.Reactivate(); }); }
public void Open() { panel.Open(); panel.SearchPattern = TextArea.Selection.GetText(); Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate { panel.Reactivate(); }); }