Reputation: 679
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!
Upvotes: 0
Views: 3460
Reputation: 30830
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.
Upvotes: 9