question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AppBarButton doesn't react to AppBarButtonBackgroundPointerOver when in CommandBar

See original GitHub issue

Describe the bug AppBarButton doesn’t react to AppBarButtonBackgroundPointerOver when in CommandBar

Steps to reproduce the bug

Steps to reproduce the behavior: Use this code:

    <Grid>
        <CommandBar Background="Transparent">
            <CommandBar.PrimaryCommands>
                <AppBarButton Icon="Add" Label="Add">
                    <AppBarButton.Resources>
                        <SolidColorBrush x:Key="AppBarButtonBackgroundPointerOver" Color="AliceBlue"/>
                    </AppBarButton.Resources>
                </AppBarButton>
            </CommandBar.PrimaryCommands>
        </CommandBar>

    </Grid>

Expected behavior The AppBarButton should have AliceBlue color when the pointer is over

Screenshots

Screenshot (23)

Version Info

NuGet package version: Microsoft.UI.Xaml 2.4.2

Windows 10 version Saw the problem?
Insider Build (xxxxx)
November 2019 Update (18363) Yes
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Mobile
Xbox
Surface Hub
IoT

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ivbergcommented, Jun 16, 2021

Do we know what the status of this is? It seems this is an issue with the latest WinUI3 and not sure what the workaround is? I tried using styles (AppBarButtonBackgroundPointerOver) but they don’t seem to be recognized?

https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.appbarbutton?view=winui-3.0 https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/xaml-styles

1reaction
ranjeshjcommented, May 27, 2020

CommandBar uses reveal on its children which likely what is causing this. You cannot get both reveal and this color at the same time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CommandBar.Content AppBarButton Label position right
So now how I trigger that the label are on the right? DefaultLabelPosition doesn't effect the content values. I want to create a...
Read more >
AppBarButton Class (Windows.UI.Xaml.Controls)
Represents a templated button control to be displayed in an AppBar. ... For more info, design guidance, and code examples, see Command bar....
Read more >
CommandBar Class (Microsoft.UI.Xaml.Controls)
Represents a specialized app bar that provides layout for AppBarButton and related command elements.
Read more >
CommandBar
The AppBarButton in Uno is designed to be used the same way you would use the AppBarButton on UWP. In most cases, you...
Read more >
[Solved]-CommandBar.Content AppBarButton Label position right-C#
1) DefaultLabelPosition can be used in apps targeting Anniversary Update. So if you want to use this for apps targeting previous versions, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found