У меня есть следующий код, который составляет HubSection
в пределах Hub
.Поиск того, что выбрано в HubSection GridView DataTemplate
<HubSection DataContext="{Binding Path=[0], Source={StaticResource groupedItemsViewSource}}" Padding="40,30,40,0">
<HubSection.Background>
<ImageBrush ImageSource="Images/BG.jpg" Stretch="UniformToFill" />
</HubSection.Background>
<HubSection.Header>
<TextBlock x:Uid="Section1Header" TextLineBounds="TrimToBaseline" OpticalMarginAlignment="TrimSideBearings" Text="English"/>
</HubSection.Header>
<DataTemplate>
<GridView
x:Name="itemGridView1"
Margin="-4,-4,0,0"
AutomationProperties.AutomationId="ItemGridView"
AutomationProperties.Name="Items In Group"
ItemsSource="{Binding Items}"
ItemTemplate="{StaticResource Standard240x320ItemTemplate}"
SelectionMode="Single"
IsSwipeEnabled="false"
IsItemClickEnabled="True"
ItemClick="ItemView_ItemClick">
</GridView>
</DataTemplate>
</HubSection>
У меня есть AppBar установить, как хорошо, но я не знаю, как сказать AppBar, что выбрано в HubSection.
Просьба сообщить.
Редактировать: Чтобы уточнить, я сталкиваюсь с проблемами с кодом реализации, например itemGridView1.selectedItem
, потому что мне говорят, что «не существует в текущем контексте».
Как-то это мероприятие не увольняло меня, и меня заставили изменить на событие ItemClick ... – garenyondem