Saturday, 15 March 2014

c# - ClipBoard.SetText throws exception when application is running under lock screen Windows phone 8 -



c# - ClipBoard.SetText throws exception when application is running under lock screen Windows phone 8 -

i'm building windows phone application allow user set text remotely when application running under lockscreen.

when called clipboard.settext("some data") when application under lock screen, throws next exception:

at ms.internal.xcpimports.checkhresult(uint32 hr) @ ms.internal.xcpimports.clipboard_settext(string text) @ system.windows.clipboard.settext(string text) ...

any suggestion or workaround issue?

according [msdn]1 clipboard.settext method restricted usage of user-initiated action only. hence not expect .settext work in locked mode.

well app user this makes sense. wouldn't wan't app messing around clipboard while i'm not using app. say, re-create number , time want paste number app replaced number text....

copied remarks: ... these apis can invoked within context determined silverlight runtime in response user-initiated action. example, clipboard access valid within handler click or keydown event. examples of situations not considered user-initiated, clipboard access not valid handler loaded or constructor.

what about: app persists text in temporary store (persisting setting or variable instance) , updates clipboard whenever user returns app?

c# windows-phone-8

No comments:

Post a Comment