Setting the image size.

Mar 15, 2011 at 3:54 PM

In my left hand column I have images whose source sizes are all different.  This causes the vertical separator to be in different positions and the height of the items to be different.  I seem to be missing the method or property that forces the items to be the same size and forces the vertical line on the left side to be straight.  Is there one?  I can't see where to pass in what size my left image should be.

Thanks for any help.


Mar 15, 2011 at 6:20 PM

You will want to use the ImageMinWidth property to fix this.

Mar 15, 2011 at 9:47 PM

The ImageMinWidth didn't work.  Anyway, the problem should be the ImageMAXWidth.  Plus - I don't really want to have to add that to every item in the popup.   I finally just restyled the PopupMenuItem and added MaxHeight and MaxWidth to the ImageLeft section. 

But it would be nice to specify in the PopupMenu tag whether you want the items to be a uniform size and what size the items should be if so.


Mar 16, 2011 at 6:47 AM
Edited Mar 16, 2011 at 1:07 PM

Got your point Dbrenth. I'll fit in the ImageWidth property in the next release.

Sorry, I wrongly assumed all your images were small enough in order not to be bothered about the maximum width. Otherwise ImageMinWidth would have sufficed to keep the separators aligned.

An easy solution for this would be add a property which would be bound to the image width instead of its minimum width but, as you mentioned, there will still the need to set it for each item in the menu thus leaving us with a half baked solution.

Unfortunately I haven't found a solid workaround for this that would also not add too many bytes to the final assembly since this would require setting the min/max width for each item in the menu, iteratively through code, while not missing out newly added ones, if any. Styling the ItemContainerStyle for the PopupMenu might be another answer but I'm afraid this might require a drastic change in the menu architecture.

For now the only solutions I can come up with, when using oversized images, are restyling the PopupMenuItem, like you just did, or just making sure your images are appropriately sized from the start.

Thanks for pointing this out Dbrenth, I'll definitely consider your request in the next release. Until then any ideas are most welcome.