How can you make the content of a ListBoxItem copyable? not editable.
Asked
Active
Viewed 367 times
1 Answers
1
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

Amsakanna
- 12,254
- 8
- 46
- 58
-
And if you run into an error right away, see http://stackoverflow.com/questions/68666/clipbrd-e-cant-open-error-when-setting-the-clipboard-from-net. – DuckMaestro Jul 21 '15 at 05:45