James Mundy
James Mundy

Reputation: 4329

Styling Windows Phone 8.1/WinRT AppBarButton

I'm currently looking to implement a CommandBar for a WinRT Windows Phone 8.1 app. Overall it is very straightforward but I am unable to style the control.

I have themed my app so that the accent colour has been changed to green. This works well for pretty much everywhere in the app (buttons, textblocks etc.) but not for the AppBarButton.

The brushes I'm overriding are SystemColorControlAccentBrush and PhoneAccentBrush but changing these does not make any difference to the colour of the AppBarButton when pressed: AppBarButtonPressed

Any idea what I'm doing wrong/can this colour be changed?

Upvotes: 2

Views: 333

Answers (2)

Rohit Garg
Rohit Garg

Reputation: 598

try changing app bar button color

            <AppBarButton x:Uid="SendMessageButton" Icon="Send" Foreground="" Background=""  Command="{Binding SendMessageCommand}" IsEnabled="{Binding IsSendMessageButtonEnabled}"/>

or change in code behind

  AppBarButton app = new AppBarButton();
            app.Foreground="";
            app.Background="";

Upvotes: -1

Rob Caplan - MSFT
Rob Caplan - MSFT

Reputation: 21889

Set the CommandBar's foreground and background colors.

The command bar on Windows Phone is system UI not app UI and does not allow customizing the colors of individual AppBarButtons. Their colors always come from the CommandBar's colors.

Upvotes: 3

Related Questions