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)?
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!
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With