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

EasyGoingPatEasyGoingPat GBMember ✭✭✭

Hi,

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="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.App">
    <Application.Resources>
        <ResourceDictionary>
            <Style x:Key="TitleStyle" TargetType="Label">
                <Setter Property="TextColor" Value="#0FC0C0"/>
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>

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

Answers

Sign In or Register to comment.