(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .

Tip: How to use enumeration as data source?

(0 votes)
Denislav Savkov
Denislav Savkov
Joined Feb 11, 2008
Articles:   14
Comments:   6
More Articles
1 comments   /   posted on Aug 29, 2008
Categories:   Data Binding

Currently there is no way to do that by using binding. Instead, you can make a List<> and add the values from the enumeration in the list. Then you can use this list as data source.


List<Dock> enumDataSource = new List<Dock>() { Dock.Left, Dock.Top, Dock.Right, Dock.Bottom };
this.lbDock.ItemsSource = enumDataSource;

where lbDock is of type ListBox.

That's it!



  • -_-

    RE: Tip: How to use enumeration as data source?

    posted by Amr on May 25, 2009 20:11

Add Comment

Login to comment:
  *      *