I want the user to select one out of many elements.
So I’m creating a long list of StringElement, each one with a specific caption. Each element is associated with a specific value. My ideas was to set the Value property of the StringElement. However, this makes the value being shown on the right side of the element.
How can I hide this value? I only need it when the user tapped an entry.
Except for the most basic settings-like dialog I end up (90% of the time) defining my own
Elementtypes. It solves many issues (like this one) and reduce duplicated code.So you get something like:
You might also want to use the
captionas the key to (an existing?)Dictionary<string,string>to reduce the memory requirement of each element (depending on how long your list turns out to be). In any case having your ownElementtype makes it easier to change its storage/behaviour in the future (with minimal impact elsewhere in your code).