I have a MacOS PopupMenu in a limited space and I want to offer the user expanded selection criteria but I only want to display the selected key when chosen.
For instance, when dropped down the user sees “15435 • The Old Man and The Sea • 1952 • Hemingway”
But after selection I want the the popup to cleanly show only “15435”.
Problem is, if I add all the criteria to the rows, upon selection I get an ugly-looking popup with truncated text and an ellipsis.
In SelectionChanged, you can set the short version (remove the selected row, insert the new one and select the row; have a boolean property set to true while you do all this so you ignore extra SelectionChanged events).
Then, in MouseDown, you can do the opposite: remove the short, displayed, version and replace it with the long version.