2017-01-18 46 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发布期间,它在其他控件中被允许。 –