Default Context Menu change only colors

24 views Asked by At

Default ContextMenu

I have this problem I set up style for my wpf window and part of it is used in default ContextMenu but there still are part of default style. I try to just set up background for every type of controls but this didn't change anything. I try to change systems colors in my xaml, did not work I try to catch it to change style colors, but context menu is null in TextBox so no luck here Microsoft was no help at all, every topic about was remove and documentation don't talk abaut it. every other topic about it is how to rewrite this context menu and that is not what I what What did I miss? I just what to change background and foreground

1

There are 1 answers

0
Mikołaj Frankiewicz On

So I spend a criminal amount of time to find what is happening, this is my findings: What change color for default ContextMenager is TextBlock, it is bug coming from some wrong cashing(not sure why and how it work, but ok). this should not happen but there is this TextBlock bug that is not fully fix. What people said in past TestBlock style change Label to. There was suggestion how to avoid this problem, create control that take from TextBlock but don't change anything, and use style for this new Control.

To main part of my question, it is impossible to set up style for default ContextMenu, you need to make your own, but you can use the same method used in default one.