How to change the color of the application bar in Windows Phone?

In my application, I want the color of the application bar to be white and full opaque without touching the theme. So far I have experimented with this.

ApplicationBar.Opacity = 1;
ApplicationBar.BackgroundColor = Color.FromArgb(52, 50, 2, 181);

The result is a light pink color with some transparency. In addition, I would like to keep the same theme of the color (light theme) icon, even if the theme is dark. I saw applications in the WP store (mostly Skype) that do this. Answers are welcome.

+4
source share
1 answer

Two ways, either in XAML:

<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar BackgroundColor="White" ForegroundColor="Black">
        <shell:ApplicationBar.Buttons>
            <shell:ApplicationBarIconButton Text="A button" IconUri="/Assets/AppBar/new.png" />
        </shell:ApplicationBar.Buttons>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

Or in the code behind:

using System.Windows.Media;
...
ApplicationBar.ForegroundColor = Colors.Black; // Icon and text color
ApplicationBar.BackgroundColor = Colors.White; // Application bar background color

, BackgroundColor , ForegroundColor . .

opacity, 1 ( ).

+3

Source: https://habr.com/ru/post/1542772/


All Articles