Create ContextMenu on the fly from code - Silverlight Studio and Shared Library for Silverlight Forum Cart Not logged in Log In Register Forgot Password Resend Validation E-mail Products WPF Controls WinRT Controls Silverlight Controls WinForms Controls ASP.NET Controls Code Writer App Icons Download Evaluations Freeware Online Demos Purchase Shopping Cart Price Lists Sales FAQ Support My Account Support Tickets Knowledge Base Consulting Services Community Blog Twitter Page Discussion Forums Polls WPFpedia Company About Us Contact Us Policies Our Customers Testimonials News Room Media Kit Careers Back to Forum Previous Thread Next Thread Discussion Forums Silverlight Studio and Shared Library for Silverlight Create ContextMenu on the fly from code Robert Croshere Version: 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 Comments (5) by Actipro Software Support - Cleveland, OH, USA Hi Robert, Here is an example of dynamically showing a ContextMenu: Actipro Software Support by Robert Croshere That article doesn't help much as it is based on the ContextMenu in the Silverlight Toolkit. That control exposes HorizontalOffset and VerticalOffset properties. I'm using the Actipro ContextMenu, which doesn't have those properties, so I have no idea on how to place the context menu at the mouse position. Robert by Actipro Software Support - Cleveland, OH, USA Hi Robert, Sorry, you're right. I thought we had the HorizontalOffset and VerticalOffset properties like the Silverlight Toolkit version. I've added those properties to our ContextMenu for the next release, so you can set an offset like in the link above. Actipro Software Support by Robert Croshere Ok, thanks, I'll wait for that then. Any idea when the next release is expected? Regards, Robert by Actipro Software Support - Cleveland, OH, USA Hi Robert, We'll try and get one out in the next couple weeks. Actipro Software Support Add a Comment Please log in to a validated account to post comments. Products WPF Controls WinRT Controls Silverlight Controls WinForms Controls ASP.NET Controls Code Writer App Icons Download Evaluations Freeware Online Demos Purchase Shopping Cart Price Lists Sales FAQ Support My Account Support Tickets Knowledge Base Consulting Services Community Blog Twitter Page Discussion Forums Polls WPFpedia Company About Us Our Customers Testimonials News Room Media Kit Careers Contact Us return false; type: 'POST', cache: false, async: false, else return false; return false; doctype: '', return false; type: 'POST', cache: false, async: false, else
Clker.com is owned by Rolera LLC, 2270 Route 30, Oswego, IL 60543 support\at\clker\dot\com
Comments