Hi @DotNET Fan ,
Welcome to Microsoft Q&A!
You need to set the CommandBar Style with template resources. This text 265618-mainpagexmal.txt contains all xaml code.
- Open
Document Outline
window, right-click yourCommandBar
, selectEdit Tmplate
, selectEdit a copy
. The template resources will be added in your page.xaml.
- Ellipses remain black. In template resources, the ellipse's style is defined in
<Style x:Key="EllipsisButtonRevealStyle" TargetType="Button">
. Change the Foreground color to Black when the state of ellipse button isPointerOver
andPressed
.
</VisualState> 3 CommandBar and Popup list remain white.<VisualState x:Name="PointerOver"> ... <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> <DiscreteObjectKeyFrame KeyTime="0" Value="black"/> </ObjectAnimationUsingKeyFrames> ... </VisualState> <VisualState x:Name="Pressed"> ... <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> <DiscreteObjectKeyFrame KeyTime="0" Value="black"/> </ObjectAnimationUsingKeyFrames> ...
In template resources, the style of popup list is defined in<Popup x:Name="OverflowPopup">
AddBackground="{TemplateBinding Background}"
inCommandBarOverflowPresenter
. Make the background color of the popup consistent with the background color set by the commandbar. <CommandBarOverflowPresenter Background="{TemplateBinding Background}" x:Name="SecondaryItemsControl" IsTabStop="False" Style="{TemplateBinding CommandBarOverflowPresenterStyle}">
4 Use the new style and set the background to white.
<CommandBar Style="{StaticResource CommandBarStyle1}" Background="White" ...>
The result looks like this
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.