Как сделать так, чтобы командная панель указывала вниз в UWP

#c# #xaml #uwp

#c# #xaml #uwp

Вопрос:

При нажатии кнопки командная панель расширяется вверх. Как заставить командную панель расширяться в противоположном направлении?

введите описание изображения здесь

Код:

      <CommandBar>
        <AppBarToggleButton Icon="Shuffle" Label="Shuffle" />
        <AppBarToggleButton Icon="RepeatAll" Label="Repeat"/>
        <AppBarSeparator/>
        <AppBarButton Icon="Back" Label="Back" />
        <AppBarButton Icon="Stop" Label="Stop" />
        <AppBarButton Icon="Play" Label="Play" />
        <AppBarButton Icon="Forward" Label="Forward"/>
        
        <CommandBar.Content>
            <TextBlock Text="Now playing..." Margin="12,14"/>
        </CommandBar.Content>
    </CommandBar>
  

Ответ №1:

Вы должны отредактировать ControlTemplate , как предлагается здесь.

На GitHub доступен полный пример кода:

 <CommandBar Style="{StaticResource OpenDownCommandBar}">
    <CommandBar.Content>
        ...
    </CommandBar.Content>
</CommandBar>