views:

35

answers:

1

If I want to access the clipboard with MVVM how can I do it?

A: 

SL 4 now supports text clipboard operations. This is transparent in OOB mode and requires user confirmation if not in OOB mode.

You can use Clipboard.GetText() in your view models and commands to retrieve the text content available in the clipboard.

vc 74
I am actually asking in a MVVM app, where should clipboard logic go. Is accessing the Clipboard from my ViewModel be a good idea?
jiewmeng
Do you mean 'as opposed to doing it in the XAML code behind'? If so, I believe the answer is no. To me it seems legitimate the view model is aware of the clipboard.
vc 74