title: Align Pivot Header items in Center of the Page
body: <p>I am using Pivot control in my UWP application. The problem is that Pivot aligns its Header items on the left side of the page. Is it possible to align them in the center of the page? I have tried this with custom style for PivotItemHeader, but it didn't work out. My style is shown below.</p>
  
  <pre><code>&lt;Style TargetType="PivotHeaderItem"&gt;
          &lt;Setter Property="FontSize" Value="{ThemeResource PivotHeaderItemFontSize}" /&gt;
          &lt;Setter Property="FontFamily" Value="{ThemeResource PivotHeaderItemFontFamily}" /&gt;
          &lt;Setter Property="FontWeight" Value="{ThemeResource PivotHeaderItemThemeFontWeight}" /&gt;
          &lt;Setter Property="CharacterSpacing" Value="{ThemeResource PivotHeaderItemCharacterSpacing}" /&gt;
          &lt;Setter Property="Background" Value="Transparent" /&gt;
          &lt;Setter Property="Foreground" Value="Gray" /&gt;
          &lt;!-- original value {ThemeResource SystemControlForegroundBaseMediumBrush} --&gt;
          &lt;Setter Property="Padding" Value="{ThemeResource PivotHeaderItemMargin}" /&gt;
          &lt;Setter Property="Height" Value="48" /&gt;
          &lt;Setter Property="VerticalContentAlignment" Value="Center" /&gt;
          &lt;Setter Property="IsTabStop" Value="False" /&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="PivotHeaderItem"&gt;
                      &lt;Grid x:Name="Grid" Background="{TemplateBinding Background}"&gt;
                          &lt;Grid.Resources&gt;
                              &lt;Style x:Key="BaseContentPresenterStyle" TargetType="ContentPresenter"&gt;
                                  &lt;Setter Property="FontFamily" Value="Segoe UI" /&gt;
                                  &lt;Setter Property="FontWeight" Value="SemiBold" /&gt;
                                  &lt;Setter Property="FontSize" Value="15" /&gt;
  
                                  &lt;Setter Property="TextWrapping" Value="Wrap" /&gt;
                                  &lt;Setter Property="LineStackingStrategy" Value="MaxHeight" /&gt;
                                  &lt;Setter Property="TextLineBounds" Value="Full" /&gt;
                                  &lt;Setter Property="OpticalMarginAlignment" Value="TrimSideBearings" /&gt;
                              &lt;/Style&gt;
                              &lt;Style x:Key="BodyContentPresenterStyle" TargetType="ContentPresenter" BasedOn="{StaticResource BaseContentPresenterStyle}"&gt;
                                  &lt;Setter Property="FontFamily" Value="{ThemeResource PivotHeaderItemFontFamily}" /&gt;
                                  &lt;Setter Property="FontWeight" Value="{ThemeResource PivotHeaderItemThemeFontWeight}" /&gt;
                                  &lt;Setter Property="FontSize" Value="{ThemeResource PivotHeaderItemFontSize}" /&gt;
  
                              &lt;/Style&gt;
                          &lt;/Grid.Resources&gt;
                          &lt;VisualStateManager.VisualStateGroups&gt;
                              &lt;VisualStateGroup x:Name="SelectionStates"&gt;
                                  &lt;VisualStateGroup.Transitions&gt;
                                      &lt;VisualTransition From="Unselected" To="UnselectedLocked" GeneratedDuration="0:0:0.33" /&gt;
                                      &lt;VisualTransition From="UnselectedLocked" To="Unselected" GeneratedDuration="0:0:0.33" /&gt;
                                  &lt;/VisualStateGroup.Transitions&gt;
                                  &lt;VisualState x:Name="Disabled"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="Unselected" /&gt;
                                  &lt;VisualState x:Name="UnselectedLocked"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;DoubleAnimation Storyboard.TargetName="ContentPresenterTranslateTransform" Storyboard.TargetProperty="X" Duration="0" To="{ThemeResource PivotHeaderItemLockedTranslation}" /&gt;
                                          &lt;DoubleAnimation Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0" To="0" /&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="Selected"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource currentThemeColor}" /&gt;
                                              &lt;!-- original value {ThemeResource SystemControlHighlightAltBaseHighBrush} --&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="UnselectedPointerOver"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseMediumHighBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="SelectedPointerOver"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseMediumHighBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="UnselectedPressed"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseMediumHighBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="SelectedPressed"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseMediumHighBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background"&gt;
                                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /&gt;
                                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                              &lt;/VisualStateGroup&gt;
                          &lt;/VisualStateManager.VisualStateGroups&gt;
                          &lt;ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"&gt;
                              &lt;ContentPresenter.RenderTransform&gt;
                                  &lt;TranslateTransform x:Name="ContentPresenterTranslateTransform" /&gt;
                              &lt;/ContentPresenter.RenderTransform&gt;
                          &lt;/ContentPresenter&gt;
                      &lt;/Grid&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  </code></pre>