2012-01-17 3 views
1

Windows Phone 7 응용 프로그램 페이지의 ListPicker 컨트롤에서 항목을 선택하려고하면 런타임에 발생하는 이상한 예외에 대한 해결책을 찾기 위해 노력하고 있습니다. 페이지는 다음과 같습니다. 정말 간단하고 아주 기본적인 재료를 포함, 예외 메시지는 다음과 같습니다 매개 변수가 잘못된, 그것은 여기 이 5 개 항목의 한계로 인해 발생 내가매개 변수가 올바르지 않습니다. ListPicker Items 예외

 <toolkit:ListPicker x:Name="lstColor" Grid.Row="3" > 
      <toolkit:ListPicker.Items> 
       <toolkit:ListPickerItem x:Name="Blue"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="Blue" Width="40" Height="40"/> 
         <TextBlock Text="Blue" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
       <toolkit:ListPickerItem x:Name="Grey"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="Gray" Width="40" Height="40"/> 
         <TextBlock Text="Grey" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
       <toolkit:ListPickerItem x:Name="Orange"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="Orange" Width="40" Height="40"/> 
         <TextBlock Text="Orange" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
       <toolkit:ListPickerItem x:Name="Pink"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="Pink" Width="40" Height="40"/> 
         <TextBlock Text="Pink" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
       <toolkit:ListPickerItem x:Name="Purple"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="Purple" Width="40" Height="40"/> 
         <TextBlock Text="Purple" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
       <toolkit:ListPickerItem x:Name="Red"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="Red" Width="40" Height="40"/> 
         <TextBlock Text="Red" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
       <toolkit:ListPickerItem x:Name="White"> 
        <StackPanel Orientation="Horizontal"> 
         <Rectangle Fill="White" Width="40" Height="40"/> 
         <TextBlock Text="White" Margin="20,0"/> 
        </StackPanel> 
       </toolkit:ListPickerItem> 
      </toolkit:ListPicker.Items> 
     </toolkit:ListPicker> 
+0

App_UnhandledException 예외가 잡히지 않으면 이벤트 처리기가 발생합니다. 종속 된 코드가 있습니다. ?? – MethodMan

+0

그것은 단지 생성자와 InitializeComponent에 대한 호출이있는 빈 페이지입니다. 이것은 ItemCountThreshold 속성으로 인해 발생하는 것으로 추측됩니다. 기본값은 5이고 두 항목을 떨어 뜨렸을 때 7 개의 항목이 있습니다. 완벽하게 작동합니다. 해결책을 찾으려고 노력 중이다. – Waleed

답변

2

를 사용하고있어 XAML입니다 App_UnhandledException 이벤트 핸들러에서 잡은 것입니다 이를 극복하는 유일한 방법은 ItemTemplate을 사용하는 것입니다. 8 월 버전의 툴킷에서는 ListPickerMode 및 ItemCountThreshold 속성을 설정할 수 없습니다. 항목을 7 개 추가하면 컨트롤이 전체 모드로 전환되고 항목이 전체 모드 팝업의 ListBox에 추가됩니다. 이 문제를 일으키는 원인은 유일한 해결 방법은 템플릿과 바운드 목록을 사용하는 것입니다./ -1 to MS

관련 문제