There are a few identical questions in SO asking about changing the background color of a button in UWP (Universal Windows Platform):
How to change the background color of button in Universal Windows Platform Apps?
how to change background color of button in UWP Apps in c# ?
However, it seems that Microsoft has been changing things. SolidColorBrush
can no longer be found. I have tried using Windows.UI.Xaml.Media.Brush
and Windows.UI.Colors
. None of those work.
Mouse hovering over button.background, the hint shows that background is expecting type: Windows.UI.Xaml.Media.Brush
.
My Question: How do I change the background color of a button using c# codes? If I use the suggested solutions in other identical posts, namespace SolidColorBrush
will not be found.