How can you make the content of a ListBoxItem copyable?
How can you make the content of a List开发者_开发问答BoxItem copyable? not editable.
You can achieve this using a contextmenu, a button or keybinding(Ctrl+C)
If you've your ListBoxItem content ready in your viewmodel then in the command initiated by one of the above say
Clipboard.SetData(DataFormats.Text, (Object)contentOfListBoxItem);
This would copy the contentOfListBoxItem to clipboard
精彩评论