Is in-line OnPlatform syntax deprecated in XF 5.x XAML?

Shantimohan Elchuri 721 Reputation points
2021-04-07T15:59:51.787+00:00

I was using the following syntax before XF 5.x:

<Setter Property="LineHeight" Value="{OnPlatform Default=1.25, iOS=-1}"/>
FontSize="{OnPlatform Android=14, iOS=18, UWP=24}"

But now after upgrading to Xamarin.Forms 5.x I get "Invalid property path syntax" error on the Default and Android settings. But the run doesn't stop.

Am I doing something wrong?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,378 questions
{count} votes

Accepted answer
  1. JarvanZhang 23,966 Reputation points
    2021-04-15T06:25:43.957+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    I get "Invalid property path syntax" error on the Default and Android settings. But the run doesn't stop.

    @Shantimohan Elchuri I tested the code in my side and faced the same issue. It's just to be an illustrate error which will not effect the build. The problem is due to the upgrate of VS, and it'll be fixed in VS 16.10.

    Here is the realted link, please check it:
    https://developercommunity.visualstudio.com/t/Erreur-XLS0517---Invalid-property-path-s/1361205

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.