简体   繁体   中英

Listbox Data Binding Windows Phone

windows phone 8 ListBox binding with list of items

listbox.Datacontext = List;

but still got nothing.

您应该像这样使用ItemsSource属性:

listbox.ItemsSource = List;

listbox.ItemSource = List;

it will directly bind the data

if you use

listbox.Datacontext = List; you should mention the binding in xaml like this

<ListBox x:Name="listbox" ItemsSource="{Binding}"></ListBox>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM