Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayMemberPath of ComboBox not working in it's dropdown list. #8

Closed
niubizi opened this issue Nov 20, 2019 · 1 comment
Closed

Comments

@niubizi
Copy link

niubizi commented Nov 20, 2019

combobox

<ComboBox Name="ComboBox"
          IsEditable="False"
          DisplayMemberPath="Name"
          SelectedValuePath="Id"
          ItemsSource="{Binding Path=Items}" />
public class ViewModel
{
    public ViewModel()
    {
        Items = new List<MyItem> {new MyItem(1, "item1"), new MyItem(2, "item2")};
    }

    public List<MyItem> Items { get; }

    public class MyItem
    {
        public MyItem(int id, string name)
        {
            Id = id;
            Name = name;
        }
        public int Id { get; }
        public string Name { get; }
    }
}
@Kinnara
Copy link
Owner

Kinnara commented Nov 20, 2019

Good catch. Fixed in v0.5.1 which has been published on NuGet. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants