Hi,
I need to create a context menu for a Silverlight control on demand; i.e. when the user right clicks on the control I want to create the context menu and display it. I know I can use the ContextMenuService, however, calling ContextMenuService.SetContextMenu(..) from the MouseRightButtonDown event seems to be too late (I assume the ContextMenuServic hooks the MouseRightButtonDown event) and the menu only gets displayed when clicked for the second time (or more). I also tried displaying the ContextMenu myself, however, the PopupOffset property of the ContextMenu class is internal, so I have no way of positioning the context menu. any ideas on how I can get thise to work?
Thanks,
Robert
I need to create a context menu for a Silverlight control on demand; i.e. when the user right clicks on the control I want to create the context menu and display it. I know I can use the ContextMenuService, however, calling ContextMenuService.SetContextMenu(..) from the MouseRightButtonDown event seems to be too late (I assume the ContextMenuServic hooks the MouseRightButtonDown event) and the menu only gets displayed when clicked for the second time (or more). I also tried displaying the ContextMenu myself, however, the PopupOffset property of the ContextMenu class is internal, so I have no way of positioning the context menu. any ideas on how I can get thise to work?
Thanks,
Robert