1

How can you make the content of a ListBoxItem copyable? not editable.

baron
  • 10,831
  • 20
  • 52
  • 88

1 Answers1

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
  • 11,291
  • 8
  • 45
  • 56
  • 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