File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,21 @@ public MainWindow()
4949 }
5050 private void OnCopy ( object sender , ExecutedRoutedEventArgs e )
5151 {
52- var _NewClipboard = QueryTextBox . SelectedText ;
52+
5353 if ( QueryTextBox . SelectionLength == 0 )
5454 {
5555 var results = _viewModel . Results ;
5656 var result = results . SelectedItem ? . Result ;
5757 if ( result != null ) // SelectedItem returns null if selection is empty.
5858 {
59- _NewClipboard = result . Title . ToString ( ) ;
59+ System . Windows . Clipboard . SetDataObject ( result . Title . ToString ( ) ) ;
6060 }
61-
61+
62+ }
63+ else
64+ {
65+ System . Windows . Clipboard . SetDataObject ( QueryTextBox . SelectedText ; ) ;
6266 }
63- System . Windows . Clipboard . SetDataObject ( _NewClipboard ) ;
6467 e . Handled = true ;
6568 }
6669 private async void OnClosing ( object sender , CancelEventArgs e )
You can’t perform that action at this time.
0 commit comments