I have added a default menu control to my user control. I need to style the menu to remove the left margin containing the space for the icon or checkbox. How can I do this?
To remove the space and never use icons you have to change the template of MenuItem.SubmenuItemTemplateKey or the template of MenuItem. If you just need to get read of the vertical line and keep using the icons space folow this answare.
Windows with grid has my CustomContextMenu.xaml as grid resource:
test
Here is my CustomContextMenu.xaml that has a CustomSeparatorStyle template to extend the separation line to the left margin of the context menu. And a ContextMenu template to hide the vertical line.
The right sude menu is created with the code above. You can notice the difference in size and shadow. In order to keep the shadow of the original menu you have to exclude the Border.Effect