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
2010-10-14 10:59:50
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
2010-10-14 11:05:08
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
2010-10-14 11:20:28