Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone Application Bar's Icons colors

When does exactly the color of appbar's icon changes (that is, from white to black, or drom black to white)? When the theme is switched from black to white, or when the background brush of Application Bar is changed? What I if I want to apply my own custom theme, so that the application bar is always white? I use black icons, but will they turn to white in Dark theme, even thouh the app bar is white (as it was customly changed)?

like image 857
Marc Andreson Avatar asked Dec 20 '22 23:12

Marc Andreson


2 Answers

All the icons used in the ApplicationBar should be 48x48 PNG files, white with transparent background.

Windows Phone will take care of changing the color of the icon if the the user is using a light theme (so the icon will turn to black)

You can read here the rules for the icons, and here on how to create a new one!

like image 117
Pedro Lamas Avatar answered Feb 08 '23 20:02

Pedro Lamas


XAML

The following XAML shows how to set the foreground and background colour and opacity of the application bar.

<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Opacity="0.75" ForegroundColor="Green" BackgroundColor="Cyan" >
        <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
    <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
    <shell:ApplicationBar.MenuItems>
        <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
        <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
    </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

Same for C#

ApplicationBar = new ApplicationBar();
    //Now set the AppBar properties :
ApplicationBar.Opacity = 0.75;
ApplicationBar.BackgroundColor = Color.FromArgb(120, 0,190,190);
ApplicationBar.ForeGroundColor = Color.FromArgb(120, 0,140, 43);
like image 27
Mohamed Thaufeeq Avatar answered Feb 08 '23 21:02

Mohamed Thaufeeq