Quantcast
Viewing all articles
Browse latest Browse all 76418

Accessing ResourceDictionary from xaml to c# programmatically

How do I access the contents of my ResourceDictionary that is located my App.xaml page?

I am trying to make a label's text color that uses a color in my resource dictionary with key = "textColor"

var colorLabel = new Label { Text = "colored Text ", TextColor = (Color) Resources["textColor"]};

Gives me a null error


Viewing all articles
Browse latest Browse all 76418

Trending Articles