Hi, I'm developing a Window that has a specific function inside a larger application, being somehow a "service" window dedicated to a simple job it does not need a Ribbon that would be too complicated for the simple functionalities in this window, so I've used the XamMenu instead.
My question is, is it possible to change the default size of the menu icons (16x16) to a different one?
If I set the size of my image for example to 24x24 it is cut inside the menu so I was just wondering...
thank you in advance
Thank you for your post.
To change the default size of the menu icons, I would recommend implementing the default style for the XamMenu. A common directory to find this default style is: C:\Program Files (x86)\Infragistics\2014.2\WPF\DefaultStyles\Menu\generic.shared.xaml. Inside of this default style sheet, there is a style that targets XamMenuItem.
Inside the default style for XamMenuItem, there is an IconContentControl named "HeaderIconPresenter." This is the control that determines the width and height of the icons in your XamMenuItem. If you change the width and height of this control, you will see a larger icon for your menu item. Please note also that there is a Grid.ColumnDefinition that this IconContentControl sits in. You will also want to modify the width of this so that the IconContentControl fits.
As an alternative, you could always write an ItemTemplate for the menu item and place your item and text in there.
I have attached a sample application to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Just checking in, did you have any other questions or concerns on this matter?
I've seen your sample and it resolves the problem, however if I need to modify the whole menu item template just to achieve that goal, the future needs for maintenance in time will be not worth the effort, if instead I can just write a style to modify the small portion of the Menu Item that manages the Icon container and dimension it will be simpler.
But at the moment I haven't yet the knowledge of how templates work so I don't know if duplicate the whole template is necessary.
Thank you anyway for the solution.