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()
49
49
}
50
50
private void OnCopy ( object sender , ExecutedRoutedEventArgs e )
51
51
{
52
- var _NewClipboard = QueryTextBox . SelectedText ;
52
+
53
53
if ( QueryTextBox . SelectionLength == 0 )
54
54
{
55
55
var results = _viewModel . Results ;
56
56
var result = results . SelectedItem ? . Result ;
57
57
if ( result != null ) // SelectedItem returns null if selection is empty.
58
58
{
59
- _NewClipboard = result . Title . ToString ( ) ;
59
+ System . Windows . Clipboard . SetDataObject ( result . Title . ToString ( ) ) ;
60
60
}
61
-
61
+
62
+ }
63
+ else
64
+ {
65
+ System . Windows . Clipboard . SetDataObject ( QueryTextBox . SelectedText ; ) ;
62
66
}
63
- System . Windows . Clipboard . SetDataObject ( _NewClipboard ) ;
64
67
e . Handled = true ;
65
68
}
66
69
private async void OnClosing ( object sender , CancelEventArgs e )
You can’t perform that action at this time.
0 commit comments