Xamarin UWP : Picker displays class name when string.empty is selected

I have following code in Xamarin forms project.

   <StackLayout Orientation="Horizontal">
        <Picker x:Name="picker"
                Title="Select a monkey"
                TitleColor="Red">
            <Picker.ItemsSource>
                <x:Array Type="{x:Type x:String}">
                    <x:String> </x:String>
                    <x:String>Baboon</x:String>
                    <x:String>Capuchin Monkey</x:String>
                    <x:String>Blue Monkey</x:String>
                    <x:String>Squirrel Monkey</x:String>
                    <x:String>Golden Lion Tamarin</x:String>
                    <x:String>Howler Monkey</x:String>
                    <x:String>Japanese Macaque</x:String>
                </x:Array>
            </Picker.ItemsSource>
        </Picker>
    </StackLayout>

if you notice the 1st choice in picker is the empty string. when I run on Android I get proper value displayed. but when I run on windows platform and select the 1st option and the class name is displayed in the picker field.

the field displays: Xamarin.Forms.Picker

I would like to have this displayed as empty string than a class name.

Best Answer

Answers

Sign In or Register to comment.