2014-04-07 2 views
1
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 전화 목록 선택 도구에서 "선택"을 표시 할 수 있으며 목록 선택 도구 항목을 선택할 때마다 항목이 표시되어야합니다.Windows 전화 목록 선택 도구 문제

<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> 

답변

1

이가 "선택"을 기본으로 설정이라는 항목을 추가하려면 : 여기

내가 지금까지 가지고있는 코드입니다.

+1

답장을 보내 주셔서 감사합니다.하지만 내 항목 소스가 수동이 아닌 클래스에서 가져오고 있습니다. "{Binding}" –

+0

이 무엇이든지 소스와 바인딩되어 클래스에서 가져 와서 개체의 상태를 관리합니다. – Sajeetharan

+0

내 목록 선택 도구 항목은 웹 서비스 응답으로 제공되므로 해결 방법은 무엇입니까? 덕분에 ! –