dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 151 forks source link

Update Picker to have Func for ItemDisplayBinding #461

Open Dreamescaper opened 2 years ago

Dreamescaper commented 2 years ago

Fix #460 .

            <Picker @bind-SelectedItem="SelectedModelDefault"
                    Title="Select a model"
                    ItemDisplayBinding="ItemDisplay"
                    ItemsSource="ModelsWithDefault" />

...

    public string ItemDisplay(PickerModel model)
    {
        return $"❤️{model.Name}❤️";
    }

image

I haven't changed property name (to ItemDisplaySelector) so far, but I'd be happy to do so if you think that's better.