J.Carden
J.Carden

Reputation: 87

UWP Commandbar to right side

I want to move the CommandBar to the right side and let the AppBarButtons flow from top to down. In other words I want to rotate the CommandBar by 90 degrees from top to the right side of the Page

How can I achieve that?

J.

Upvotes: 1

Views: 575

Answers (2)

Martin Zikmund
Martin Zikmund

Reputation: 39082

You can't do that easily, because CommandBar is built for horizontal mode by default (including the expansion animations, flyout behavior, etc.). With higher effort you could be able to modify the default template to support this. Also, you can use AppBarButton controls anywhere, not just in CommandBar. My suggestion would be to use something like:

<StackPanel Orientation="Vertical">
   <AppBarButton ... />
   <AppBarButton ... />
   <AppBarButton ... />
<StackPanel>

You could use the AppBarButton's LabelPosition property set to Collapsed to hide the labels for a cleaner experience.

Upvotes: 3

Sean O&#39;Neil
Sean O&#39;Neil

Reputation: 1241

CommandBar does not have a vertical orientation mode, so you cannot do this. You could rotate it 90 degrees using

<CommandBar.RenderTransform>
    <RotateTransform CenterX="0" CenterY="0" Angle="90" />
</CommandBar.RenderTransform>

but the buttons would be rotated as well. You should consider a different control, like a SplitView.

Upvotes: 4

Related Questions