AiForms.SettingsView
AiForms.SettingsView copied to clipboard
PickerCell: Bind Enum
I would like to use the PickerCell
together with an enum. Doing this, I want to set the DisplayMember
property of the picker and set its value to a converter, so that I can convert the enum values into readable values. In a normal Xamarin.Forms.Picker
this works without a problem - sadly here, it does not. Is this the intended behavior of the property? Is it possible to implement a similar behavior?
@FlashTek
DisplayMember must be Class member name. So if the value is changed by a converter, it won't correctly work.
PickerCell is different from Xamarin.Forms.Picker at all. This behavior is my intention. For now, I am not going to plan to implement it.
Thanks.
I would upvote this also. However, it's easy enough to convert an enum to an IEnumerable
@codegrue
ItemsSource in PickeCell must be GenericType, which is necessary to get dynamically property member.
intention
Hi @muak , I'm new in Xamarin and really love your design and implementation. Actually, I'm facing a similar problem here, I would argue that sometimes the app needs a <Key, Value> list to do something for the picker (or PickerCell). Also, that would be the way how we save the picker values in the database (with key and value). ps: I tried to find the picker in the solution until I saw this "different from picker" here.
@Shaw6157 Thank you for your opinion. I will think about it a little.