У меня есть меню в CommandBar SecondaryCommands, я указал стиль CommandBar
но я не нашел строку, позволяющую изменить цвет переднего плана при наведении курсора на каждый элемент в меню. это мой код:
это мой код для CommandBar:
<CommandBar Style="{Binding Source={StaticResource commandBarStyle}}" >
<CommandBar.CommandBarOverflowPresenterStyle>
<Style TargetType="CommandBarOverflowPresenter">
<Setter Property="Background"
Value="#00a0e3" ></Setter>
<Setter Property="Margin" Value="0"></Setter>
<Setter Property="Padding" Value="0"></Setter>
<Setter Property="BorderBrush" Value="Transparent"/>
</Style>
</CommandBar.CommandBarOverflowPresenterStyle>
<CommandBar.SecondaryCommands >
<AppBarButton Label="Info"
Foreground="White" Background="#00a0e3"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
commandBarStyle — это стиль CommandBar по умолчанию для приложений магазина Windows, я добавил эти строки в раздел AvailableCommandsStates:
<VisualStateGroup x:Name="AvailableCommandsStates">
<VisualState x:Name="BothCommands"/>
<VisualState x:Name="PrimaryCommandsOnly">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OverflowContentRoot" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="SecondaryCommandsOnly">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PrimaryItemsControl" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="#00a0e3" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="White" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="#00a0e3" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="White" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
но всегда я получаю черный цвет переднего плана, когда я наводил курсор на элементы SecondaryCommands, еще раз спасибо за помощь