Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Questions regarding submenu drop down and general XamMenuItem styling questions
posted

I have attached a simple VS solution demonstrating the issues we are having getting the XamMenu to look and work as we require.

I have the following questions (you can see my attempt at resolving them in the attached solution, but it is klugey so I need some help determining the recommended approach):

(1) How can I get that a root menu item was clicked and cancel the dropdown menu?
(2) I have a composite root menu item consisting of a one row three column grid, column 0 = TextBlock and column 2 = Button (column 1 is empty to provide space between the two controls). I only want the subitems to drop down if the user clicks the button in column 1 (which has a dropdown indicator). But anywhere I click causes the click event for the menu item to fire.
(3) How can I add tooltips to the root menuitems that only display when the root menuitem has its TextTrimmed?
(4) When a root item is clicked, how can I make its text Bold and make sure all the other root elements are not bold? Related, how do I keep the root element's submenu items from inheriting the bold (i.e. just want the root to be bold, children should remain normal font weight)?

Thanks for any help,

Pat

 

xamMenuFun.zip
Parents
  • 22015
    posted

    Hello Pat,

     Thank you for your post. I have been looking into your questions.

    Regarding your first question you can use the default style for the xamMenu and change the visual state and the Opacity property for the SubMenuOpen from “1.0” to “0.0” and for the SubMenuOpenImmediately too. Then you can handle the PreviewMouseDown event, get the MenuItem and check if it has children. If it has you can apply the changed default style.

     For your second requirement would you please change the sample application you have attached in your initial post to show the mentioned functionality?

     For your third requirement you can create a style with a Key for the XamMenuItem and set the FontWeight property to bold. Then handle the ItemClicked event and apply the style for this item.

     

Reply Children