I’ve use the following code to set the image for ordinary button, but it’s not working for appbar button.
ImageBrush brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/logo.png"));
button.Background = brush;
I also try to change the Background property to Content property, but it’s still not working. Any solution for this?
You cannot set background property to a button, which style was set to AppBarButtonStyle. (a resource defined in StandardStyles.xaml in all Metro Store apps). Since the background property was not template bound to the root grid’s background, as done in default style of button.
So to achieve this, you can set the image as content of button.