C# 超宽带语义缩放
我有语义缩放C# 超宽带语义缩放,c#,xaml,windows-10,C#,Xaml,Windows 10,我有语义缩放 <SemanticZoom Grid.Row="1" Grid.Column="1" ViewChangeStarted="SemanticZoom_ViewChangeStarted"> <SemanticZoom.ZoomedOutView> <ListView Margin="0,0,0,0" Backgro
<SemanticZoom
Grid.Row="1"
Grid.Column="1" ViewChangeStarted="SemanticZoom_ViewChangeStarted">
<SemanticZoom.ZoomedOutView>
<ListView
Margin="0,0,0,0"
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}"
ItemsSource="{Binding Source={StaticResource cvs}}"
SelectionMode="None" >
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="{ThemeResource AccentBrush}" FontSize="{ThemeResource HubHeaderThemeFontSize}" Text="{Binding Key}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</SemanticZoom.ZoomedOutView>
<SemanticZoom.ZoomedInView>
<GridView
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}"
x:Name="MainCollection"
ItemsSource="{Binding Source={StaticResource cvs}}"
ItemClick="MainCollection_ItemClick"
IsItemClickEnabled="True"
SelectionMode="None">
<GridView.ItemTemplate>
<DataTemplate x:DataType="local:TileApp">
<Grid Height="60" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Image Source="{x:Bind Medium, Converter={StaticResource LinkConverter}}" Grid.Column="0"/>
<TextBlock HorizontalAlignment="Stretch" Width="350" x:Name="Name" VerticalAlignment="Center" Text="{x:Bind AppName}" Grid.Column="1"/>
<FontIcon Grid.Column="2" FontFamily="Segoe MDL2 Assets" Glyph="" />
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Foreground="{ThemeResource AccentBrush}" Text="{Binding Key}" />
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</GridView.GroupStyle>
</GridView>
</SemanticZoom.ZoomedInView>
</SemanticZoom>
问题是当我按下标题时。ZoomOutView不显示它们。我什么也没看见。但是如果您在应该有标题的位置单击,它会移动到正确的位置。在XAML中,ListView和TextBlock绑定不正确
<SemanticZoom.ZoomedOutView>
<!-- So I've removed ItemsSource property on the ListView in XAML -->
<!-- And added a name to it -->
<ListView x:Name="ZoomoutCollection"
Margin="0,0,0,0"
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}"
SelectionMode="None" >
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="{ThemeResource AccentBrush}" FontSize="{ThemeResource HubHeaderThemeFontSize}" Text="{Binding Group.Key}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</SemanticZoom.ZoomedOutView>
<SemanticZoom.ZoomedOutView>
<!-- So I've removed ItemsSource property on the ListView in XAML -->
<!-- And added a name to it -->
<ListView x:Name="ZoomoutCollection"
Margin="0,0,0,0"
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}"
SelectionMode="None" >
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="{ThemeResource AccentBrush}" FontSize="{ThemeResource HubHeaderThemeFontSize}" Text="{Binding Group.Key}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</SemanticZoom.ZoomedOutView>
var groups = from c in TilesCollection
group c by c.Category into g
orderby g.Key
select g;
this.cvs.Source = groups;
// And moved ItemsSource here, since we need a more complex binding
// Note that 'ZoomoutCollection' is the new named ListView
ZoomoutCollection.ItemsSource = this.cvs.View.CollectionGroups;