How can I data bind a list of strings to a ListBox in WPF/WP7?

后端 未结 4 1631
醉酒成梦
醉酒成梦 2020-11-27 13:42

I am trying to bind a list of string values to a listbox so that their values are listed line by line. Right now I use this:



        
4条回答
  •  臣服心动
    2020-11-27 14:10

    If the items source is enumerable as string-entries, use the following:

     
    

    You can use this syntax on any object. Generally, the ToString() -method will then called to get the value. This is in many cases very handy. But beware that no change notification will occur.

提交回复
热议问题