【发布时间】:2014-04-07 06:01:52
【问题描述】:
List<Items> list = new List<Items>();
list = (from query in doc.Descendants("row")
select new Items
{
Id = Convert.ToInt64(query.Element("Id").Value),
Name = query.Element("Name").Value,
title = query.Element("title").Value
}).ToList();
listPicker1.DataContext = list;
是否可以在 windows phone 列表选择器中默认显示“选择”,并且每当我选择列表选择器项目时,该项目都应该显示。
这是我目前的代码:
<toolkit:ListPicker ItemsSource="{Binding}" x:Name="listPicker1" FullModeHeader="Employee" SelectionChanged="ListPicker1_SelectionChanged" BorderThickness="0" Margin="130,-45,144,160" SelectedItem="{Binding}" SelectionMode="Single" ExpansionMode="FullScreenOnly" Header="" CacheMode="BitmapCache" Height="55" Background="White">
<toolkit:ListPicker.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" TextWrapping="Wrap" FontSize="22" Width="200" Height="50" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" Foreground="Blue"/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.ItemTemplate>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Name}" Margin="10" FontSize="24" TextWrapping="Wrap" Foreground="Black" Width="440"/>
<TextBlock Text="{Binding title}" FontSize="20" TextWrapping="Wrap" Foreground="Black" Width="440"/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
【问题讨论】:
标签: c#-4.0 windows-phone listpicker