Forum Xamarin.Forms

How do I use OnPlatform in an application-wide resource dictionary?

EasyGoingPatEasyGoingPat GBMember ✭✭✭


I am struggling to find the correct syntax to use the OnPlatform XAML mark-up in an application resource dictionary. I currently have something like the following, which works fine:

<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns=""
            <Style x:Key="TitleStyle" TargetType="Label">
                <Setter Property="TextColor" Value="#0FC0C0"/>

If I wanted to make the text colour of the label platform-specific, how would I do this? Every syntax I have tried so far gives me an exception.

Kind wishes ~ Patrick

Best Answers


Sign In or Register to comment.