views:

42

answers:

1

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 how do i get the active control?

A: 

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

Ziad