Window Phone ListBox的DataBinding:

             <ListBox x:Name="lstTrips" ItemsSource="{Binding}" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Name}" ></TextBlock>
                            <StackPanel>
                                <TextBlock Text="{Binding Opt}"></TextBlock>
                                <TextBlock Text="{Binding AddTime}"></TextBlock>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

lstTrips.DataContext = objDealer.Trips;

你可能感兴趣的:(listbox)