Use right click context menu paste in silverlight (4.0) from clipboard to active control
I have a grid with a bunch of textboxes for input. I wanted to implement Paste functionality. To do this for one textbox I wrapping it in a grid, adding a contextmenu with Paste item, and in the click event I set that textbox's text to the Clipboard.GetText().
But then I thought perhaps the context menu should be in the larger grid container that holds all the textboxes and then a Paste would set the text in the active textbox.
So my questions:
does the first way make sense ... I've just started using silverlight 4 and the contextmenu so not sure if this there are other (better) ways of doing this?
does the 2nd approach sound feasible?
and if so开发者_Python百科 how do i get the active control?
The following project provides a sample for what you are trying to achieve but it relies on the popupmenu instead of the contextmenu:
http://sl4popupmenu.codeplex.com
精彩评论