UWP - Centralize the Command Bar Menu in the page

The Command Bar Menu is located on the left side of the page by default. But I need to move it to the central location in the page. To do so, I have to modify the style XML of Command Bar.
 Under "<Style TargetType="CommandBar">...." , located this line "<ItemsControl
    x:Name="PrimaryItemsControl"
" and then change it as below:


<ItemsControl
    x:Name="PrimaryItemsControl"
    HorizontalAlignment="Center"
    MinHeight="60"
     IsTabStop="False"
     Grid.ColumnSpan="2">

Afterwards, you can see the Command Bar Menu is located on the central of the page.

Comments

Popular posts from this blog

React Native error - Cannot find module 'metro-react-native-babel-preset'

Top JavaScript courses helping you develop SPFx webPart with ReactJS and AngularJS

Effective ChatGPT Prompt Writing Tips