0

I have created an application bar through codes(in xaml.cs), but if i tried to change the background color of the app bar, it throws an error. I think the below codes is not correct for an app bar.

ApplicationBar.BackgroundColor = new SolidColorBrush(Colors.Black);

Can anybody help me with this? Thanks for your help!

1 Answers1

9

The BackgroundColor property type is Color and not Brush:

public Color BackgroundColor { get; set; }

So, following should work:

ApplicationBar.BackgroundColor = Colors.Black; 

PS. Most of the times, reading compile time error messages can give you a lot of clarity.

decyclone
  • 30,394
  • 6
  • 63
  • 80