1

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

baron
  • 11,011
  • 20
  • 54
  • 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
  • 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