diff --git a/src/View.xaml b/src/View.xaml index 9ee93bb..f09dfab 100644 --- a/src/View.xaml +++ b/src/View.xaml @@ -33,7 +33,8 @@ FontSize="14" ContextMenu="{x:Null}" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" - PreviewKeyDown="SearchTextBox_PreviewKeyDown" > + PreviewKeyDown="SearchTextBox_PreviewKeyDown" + PreviewMouseRightButtonDown="SearchTextBox_PreviewMouseRightButtonDown" PreviewMouseRightButtonUp="SearchTextBox_PreviewMouseRightButtonUp" > { @@ -180,5 +181,15 @@ void Window_Loaded(object sender, RoutedEventArgs e) HwndSource source = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle); source.AddHook(new HwndSourceHook(WndProc)); } + + void SearchTextBox_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) + { + SearchTextBox.Text = Clipboard.GetText(); + } + + void SearchTextBox_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e) + { + SearchTextBox.SelectionStart = SearchTextBox.Text.Length; + } } }