Skip to content

Commit abc3228

Browse files
committed
Fix a minor bug in MainDemo.wpf
Bug : Clicking the "Copy to clipboard" button in IconPackView will cause an exception to be thrown. Solution is based on StackOverflow answers : https://stackoverflow.com/questions/12769264/openclipboard-failed-when-copy-pasting-data-from-wpf-datagrid
1 parent f1ed10c commit abc3228

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MainDemo.Wpf/IconPackViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private void Search(object obj)
6363
private void CopyToClipboard(object obj)
6464
{
6565
var kind = (PackIconKind?)obj;
66-
Clipboard.SetText($"<materialDesign:PackIcon Kind=\"{kind}\" />");
66+
Clipboard.SetDataObject($"<materialDesign:PackIcon Kind=\"{kind}\" />");
6767
}
6868

6969
public event PropertyChangedEventHandler PropertyChanged;

0 commit comments

Comments
 (0)