2017-01-18 45 views
0
 <ListView ItemsSource="{Binding PageViewModel.TestCollection, Mode=OneWay}"> 
     <ListView.ItemTemplate> 
      <DataTemplate x:DataType="local:TestClass"> 
       <TextBlock >Blah</TextBlock> 
      </DataTemplate> 
     </ListView.ItemTemplate> 
     <ItemsControl.ItemsPanel> 
      <ItemsPanelTemplate> 
       <CarouselPanel /> 
      </ItemsPanelTemplate> 
     </ItemsControl.ItemsPanel> 
    </ListView> 

只是想與此控件進行實驗。它建立但掛在App.g.i.cs部署期間:CarouselPanel在UWP拋出異常

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION 
     UnhandledException += (sender, e) => 
     { 
      if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); 
     }; 

我試過幾種類型的集合,但得到相同的錯誤。

+0

當Visual Studio在UnhandledException處理程序中觸發break時,可以將鼠標懸停在'(sender,e)'部件中的'e'參數表上並查看發生的確切異常。請做到這一點,並更新後的細節關於這個例外。 –

回答

1

如果你看一下異常Message您將看到:

您正在使用的控制小組不允許作爲ItemsPanel的控制。

因此,您只能使用CarouselPanelComboBox控制。

+0

謝謝我的錯誤。很明顯,在Win 8發佈期間,它在其他控件中被允許。 –