Automatic width in ComboBox for WPF

WPF has the annoying property, that the width of the combobox is not related to the largest element in the view:

Thanks to a blog post, which I cannot find anymore, you can the Popup child item of the combobox can be queried to figure out the width of the element:

Source code can be found on Github: ComboBoxEx.cs

and corresponding Commit: Github Commit

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

This site uses Akismet to reduce spam. Learn how your comment data is processed.