例:
<toolkit:ListPicker Name="CategoryPicker" ItemsSource="{Binding Category}" CacheMode="BitmapCache" FullModeHeader="{Binding Path=Resources.TheHeader}" SelectedIndex="{Binding TheCurrentIndex, Mode=OneWay}" IsEnabled="{Binding IsViewEnabled}" TabIndex="0" Margin="12,229,12,-205" SelectionChanged="CategoryPicker_SelectionChanged"><toolkit:ListPicker.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <TextBlock Text="{Binding CategoryDesc}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontSize="{StaticResource PhoneFontSizeMediumLarge}" /> </StackPanel> </DataTemplate></toolkit:ListPicker.ItemTemplate><toolkit:ListPicker.FullModeItemTemplate> <DataTemplate> <StackPanel x:Name="item" Orientation="Horizontal" Margin="5, 24, 0, 24"> <TextBlock Margin="15, 0, 0, 0" Text="{Binding CategoryDesc}" FontSize="40" TextWrapping="Wrap" /> </StackPanel> </DataTemplate></toolkit:ListPicker.FullModeItemTemplate>
访问:
Categories selectedCategory = CategoryPicker.SelectedItem as Categories;