-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Labels
bugSomething isn't workingSomething isn't workingunverifiedBug has not been verified by maintainersBug has not been verified by maintainers
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui.Markup/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
I'm trying to use c# makup to create a Picker . When I define the Picker I get an error saying that ItemDisplayBinding property does not exist.
I tried using the following code but I still get an error "Non-invocable member 'Picker.ItemDisplayBinding' cannot be used like a method."
new Picker()
//.Title("Choose a Person")
.Bind(Picker.ItemsSourceProperty, static (MainViewModel vm) => vm.People) // Bind ItemsSource to your collection
// Fluent ItemDisplayBinding using a lambda expression:
.
(Binding.Create<Person, string>(static (item) => item.Name)) // THIS IS THE KEY!
.Margin(10)
Expected Behavior
I should be able to use property ItemDisplayBinding .
Steps To Reproduce
https://github.com/fgonc124/ItemDisplayBinding
Link to public reproduction project repository
https://github.com/fgonc124/ItemDisplayBinding
Environment
- .NET MAUI C# Markup CommunityToolkit: 4.0, 5.0 or 6.0.0
- .NET MAUI C# Markup CommunityToolkit.maui 12.1.0
- OS: Windows 11 24H2
- Microsoft Maui Controls:9.0.81
- Net 9.0 Runtime
- .NET MAUI:
- Visual Studio 17.14.7 PreviewAnything else?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingunverifiedBug has not been verified by maintainersBug has not been verified by maintainers