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;

posted on 2012-08-07 15:47  冰危节奏  阅读(170)  评论(0编辑  收藏  举报

导航