Binding Dictionary<T> to a WPF ListBox

Posted by Joan Venge on Stack Overflow See other posts from Stack Overflow or by Joan Venge
Published on 2010-03-22T18:38:22Z Indexed on 2010/03/22 18:41 UTC
Read the original article Hit count: 759

Filed under:
|
|
|
|

Given a dictionary of <string, Drink>, how would you bind the dictionary.Values to a WPF ListBox, so that the items use the .Name property?

struct Drink
{
    public string Name { get; private set; }
    public int Popularity { get; private set; }

    public Drink ( string name, int popularity )
        : this ( )
    {
        this.Name = name;
        this.Popularity = popularity;
    }
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET