我有以下 GridView
<GridView
x:Name="itemGridView"
AutomationProperties.AutomationId="ItemGridView"
AutomationProperties.Name="Grouped Items"
Grid.RowSpan="2"
Margin="0,-14,0,0"
Padding="0,0,0,50"
ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
ItemTemplate="{StaticResource Standard250x250ItemTemplate}"
SelectionMode="None"
IsSwipeEnabled="false"
IsItemClickEnabled="True"
ItemClick="ItemView_ItemClick">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel x:Name="ItemGridViewVirtualizingStackPanel" Margin="120,0,120,0" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
...
在<VisualState x:Name="FullScreenPortrait">
我尝试更改边距
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemGridViewVirtualizingStackPanel" Storyboard.TargetProperty="Margin">
<DiscreteObjectKeyFrame KeyTime="0" Value="100,0,20,0"/>
</ObjectAnimationUsingKeyFrames>
但出现错误Cannot resolve TargetName ItemGridViewVirtualizingStackPanel.
那么如何改变 VirtualizingStackPanel 的 Margin 呢?