2014-03-01 3 views
0

내 응용 프로그램에서 m 목록 선택기 컨트롤에 액세스하려고 할 때마다이 예외가 발생합니다. 내가 줄이면 내 목록 선택기에 대한System.Exception {System.ArgumentException} 값이 예상 범위 내에 있지 않음

+  this {App_name.App} App_name.App 
+  sender {App_name.App} object {App_name.App} 
-  e {System.Windows.ApplicationUnhandledExceptionEventArgs} System.Windows.ApplicationUnhandledExceptionEventArgs 
+  base {System.Windows.ApplicationUnhandledExceptionEventArgs} System.EventArgs {System.Windows.ApplicationUnhandledExceptionEventArgs} 
+  ExceptionObject {System.ArgumentException: Value does not fall within the expected range.} System.Exception {System.ArgumentException} 
     Handled false bool 
+  Non-Public members  

코드

<ListBox Margin="0,417,0,0"> 
      <ListBoxItem> 
       <toolkit:ListPicker Name="LearnerFileChooser" Width="431" > 
        <toolkit:ListPickerItem Content="A" /> 
        <toolkit:ListPickerItem Content="B" /> 
        <toolkit:ListPickerItem Content="C" /> 
        <toolkit:ListPickerItem Content="E" /> 
        <toolkit:ListPickerItem Content="F" /> 
        <toolkit:ListPickerItem Content="G" /> 
        <toolkit:ListPickerItem Content="H" /> 
       </toolkit:ListPicker> 
      </ListBoxItem> 

인 NO. 항목을 4로 설정하면 올바르게 작동하지만 4 개 이상 항목이 충돌합니다.

사용자가 선택할 수있는 영문자 목록을 만들려고합니다.

+1

가능한 중복 (http://stackoverflow.com/questions/17065970/windows-phone-toolkit-listpicker-throws-an-unhandled-exception) –

답변

3

알려진 문제입니다.

당신은

Explanation on Codeplex 이상 5. 사용할 수 있도록 항목을 결합해야합니다 ItemsControl에로

ListPicker을, 귀하의 예제에서 ListPickerItems의 목록 로 설정된 항목의 속성을 가져옵니다. ListPickerItems는 UIElements이고 이며 ListPicker는 표현 자에서 렌더링합니다. 5 또는 항목이 적 으면 현재 페이지에서 확장 모드가 열리고 발표자의 모든 항목을 볼 수 있습니다.

6 개 이상의 항목이있는 경우 목록 선택 도구를 열면 전체 모드로 이동하여 새 페이지가 열립니다. 이 새 페이지에는 목록 상자가 있으며 은 항목 속성을 listpicker의 항목으로 설정합니다. 여기가 입니다. 목록 상자의 항목을 listpicker의 항목 (이 경우 listpickeritems의 목록)으로 설정하면 목록 상자에 해당 항목의 UIElements가 표시됩니다. 이제 단일 목록 상자가 시각적 트리의 두 자리에 포함됩니다.

이 문제로 인해 ListPicker는 데이터 바인딩 및 템플릿 만 지원합니다. ListPicker의 항목을 특정 UIElements로 설정하지 마십시오. 의

+0

감사 [윈도우 폰 툴킷 ListPicker는 처리되지 않은 예외를 throw]. 알았어. :) – Arpit

관련 문제