Eto - Dropdown binding fails on Mac

So, I have a nice little Eto dropdown that should get populated from a list with custom objects.

The following code works in Windows (RH6), but fails in Mac. In the latter, instead of text values, the control shows the object type.

class MyObject
        public string Key { get; set; }
        public string Name { get; set; }


List<MyObject> myObjects = new List<MyObject>();
// ... fill list

var selector = new DropDown
                DataStore = myObjects,
                ItemKeyBinding = Binding.Delegate<myObject, string>(a => a.Key),
                ItemTextBinding = Binding.Delegate<myObject, string>(a => a.Name),

In Mac, the selector shows the type name instead of the name values:


Is this a bug or am I missing something?

It sounds like a bug to me, but you’re probably better off reporting it directly on GitHub as it seems not Rhino-related.

@curtisw, is this something you can confirm (or deny)?

Thinking about it, I knew I ran into this recently, and it is already in the issues list

The solution is to override the ToString() for the display code; in your case you may have to do some more to get it right.

1 Like

Thank you, Menno.

For the time being, I was able to make a rather clumsy workaround by assigning the string values directly via selector.Items.Add(...)

Yeah this is a known problem as @menno pointed out. I didn’t know it had the same problem on OS X, so thanks for letting me know!

I’ve updated the issue to reflect this.