2016-03-24 3 views
1

Как можно добавить кнопку или другой элемент визуального стиля только к одному узлу шаблона hubpage по умолчанию в Windows Phone 8.1?Невозможно добавить кнопку в hubpage Шаблон

Я хочу добавить кнопку обновления над списком ListView.

 <Hub x:Name="Hub" x:Uid="Hub" Header="BuLi Tweet" Foreground="White" Background="{StaticResource RasenHintergrund}"> 

     <HubSection x:Uid="HubSection1" Header="Aktueller Spieltag" Width="400" 
        DataContext="{Binding Groups[0]}" HeaderTemplate="{ThemeResource HubSectionHeaderTemplate}"> 
      <DataTemplate> 
       <ListView 
        ContinuumNavigationTransitionInfo.ExitElementContainer="True"> 
        <GridView     
        Margin="5,0,0,0" 
        ItemsSource="{Binding Items}" 
        AutomationProperties.AutomationId="ItemGridView" 
        AutomationProperties.Name="Items In Group" 
        ItemTemplate="{StaticResource MatchIcon}" 
        SelectionMode="None" 
        IsItemClickEnabled="True" 
        ScrollViewer.VerticalScrollBarVisibility="Auto" 
        ScrollViewer.VerticalScrollMode="Enabled" 
        ItemClick="ItemView_ItemClick" 
        ContinuumNavigationTransitionInfo.ExitElementContainer="True"> 
         <GridView.ItemsPanel> 
          <ItemsPanelTemplate> 
           <VariableSizedWrapGrid Orientation="Horizontal" /> 
          </ItemsPanelTemplate> 
         </GridView.ItemsPanel> 
        </GridView> 
       </ListView> 
      </DataTemplate> 
     </HubSection> 
+0

кнопки Добавить и установите видимость с помощью преобразователя (если это первый элемент затем установить видимость видимый), или вы можете использовать селектор шаблона – Archana

+0

@Archana спасибо, я вижу, где вы хотите чтобы пойти с этим ... не уверен, могу ли я понять это ... У вас есть небольшой фрагмент кода, чтобы помочь? – Ulpin

+0

Я думаю, что в этом не требуется селектор шаблонов. Пожалуйста, см. Мой ответ. Дайте мне знать, если я ошибаюсь :) – Archana

ответ

1

Надеюсь, вы хотите, чтобы кнопка внутри первой секции концентратора перед списком. Просто добавьте сетку и определить RowDefinations для сетки

 <HubSection x:Uid="HubSection1" Header="Aktueller Spieltag" Width="400" 
        DataContext="{Binding Groups[0]}" HeaderTemplate="{ThemeResource HubSectionHeaderTemplate}"> 
      <DataTemplate> 
       <Grid> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="Auto"/> 
         <RowDefinition Height="*"/> 
        </Grid.RowDefinitions> 
        <Button Content="Refresh" Visibility="{Binding}"/> 
        <ListView Grid.Row="1" 
       ContinuumNavigationTransitionInfo.ExitElementContainer="True"> 
        <GridView     
        Margin="5,0,0,0" 
        ItemsSource="{Binding Items}" 
        AutomationProperties.AutomationId="ItemGridView" 
        AutomationProperties.Name="Items In Group" 
        ItemTemplate="{StaticResource MatchIcon}" 
        SelectionMode="None" 
        IsItemClickEnabled="True" 
        ScrollViewer.VerticalScrollBarVisibility="Auto" 
        ScrollViewer.VerticalScrollMode="Enabled" 
        ItemClick="ItemView_ItemClick" 
        ContinuumNavigationTransitionInfo.ExitElementContainer="True"> 
         <GridView.ItemsPanel> 
          <ItemsPanelTemplate> 
           <VariableSizedWrapGrid Orientation="Horizontal" /> 
          </ItemsPanelTemplate> 
         </GridView.ItemsPanel> 
        </GridView> 
       </ListView> 
</Grid> 
      </DataTemplate> 
     </HubSection> 
+0

Приношу свои извинения за этот вопрос .... сидел слишком долго перед ним. глупый! Большое спасибо, это именно то, чего я хочу достичь. – Ulpin

+0

Вы приветствуете :) :) – Archana

Смежные вопросы