views:

218

answers:

2

All I wanted to do is have a context menu on a button with the width bounded to the button's width. Apparently that's to much. If you open the context menu and then decrease the size of the button and open it again everything's OK (the width gets smaller). If you increase the width (from 100 to 200 for example) the context menu's width increases too (to 200) but it only renders the previous width (100). I changed the width myself in code, used ActualWidth instead but though the values seem fine, the context menu's rendering is poor.

A: 

Not sure if this applies, but do you have the option to use the SnapToDevicePixels=True? I have found this makes a massive difference in rendering when it is not used... but I am not sure if the option is available on your context menu.

TravisPUK
I do have the option, but it has no affect.I also tried to replace the ItemsPanelTemplate but it still rendered only a part of the ContextMenu
SHD_lotion
A: 

The width of the context menu seems to be driven by the text field length of the context item with the longest text field.

If you append a bunch of spaces to one of the context item's text field this makes both that context item and the whole context menu wider.

Everything then draws fine.

Hope this helps,

Rob

Rob