Xamarin : Access style in the code behind
I defined all styles in app.xaml, which is a kind of css style and that is the centralised place to manage the look and feel. I think that is a good practice. That is no problems to access the style across other xaml file. But in code behind, how do I get it working
That is simple,
Code
txt.Style= (Style) Application.Current.Resources["name"] |
Please don't user only Resources["name"] which is only calling Resources Dictionary in your local xaml, not global app.xaml. You will get a NullReferenceException
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 67 feedbacks awaiting moderation...
Form is loading...