Is there a way to dynamicaly assign Picker.Items from XAML?
Something like:
<Picker x:Name="pckTheme">
<Picker.Items>
<x:String>{Binding Option1Text}></x:String>
<x:String>{DynamicResource Option2Text}></x:String>
</Picker.Items>
</Picker>
(This sample is not working, of course).
As far as I can tell, the only allowed type in Picker.Items is x:String and I can't seem to find any method to bind to x:String.
Doing it from code is relatively simple, but I would prefer doing it from XAML directly, if possible.
Goal here is to localize content from resource file, but other uses may come handy.
Please use the following XAML code:
<x:Array Type="{x:Type x:String}">
<x:Static Member="local:AppResources.Events"/>
<x:Static Member="local:AppResources.Device"/>
<x:Static Member="local:AppResources.Biographical"/>
</x:Array>
Where local is:
xmlns:local="clr-namespace:YOURNAMESPACE"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With