我在 Visual Studio 2015 设计器中遇到组头问题。运行我的 Windows 10 UWP 应用程序时确实会显示组标题。
我有以下 XAML:
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ListView x:Name="TracksOverview"
IsItemClickEnabled="True"
ItemsSource="{Binding Source={StaticResource TracksOverviewSource}}"
ItemTemplate="{StaticResource TrackOverview}"
RelativePanel.AlignBottomWithPanel="True"
RelativePanel.AlignTopWithPanel="True"
RelativePanel.AlignLeftWithPanel="True">
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="1900-2000"
Foreground="White" />
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
</RelativePanel>
我截取了我的设计师和我的程序的截图。
如您所见,标题没有显示在设计器视图中(左),但在运行时显示(右)。
首先我认为我的绑定有问题,但是它甚至没有显示静态文本,它确实为它保留了一些空间。
在此先感谢,瑞克