The attachable property Phone was not found in type OnIdiom

stesvisstesvis USMember ✭✭✭

I started getting this XAML warning after the latest XF version on VS 2017 v15.7.1.
This is the code in App.xaml:

<OnIdiom x:Key="largeFontSize"  x:TypeArguments="x:Double">
    <OnIdiom.Phone>
        <OnPlatform x:TypeArguments="x:Double" iOS="23" Android="23"  />
    </OnIdiom.Phone>
    <OnIdiom.Tablet>
        <OnPlatform x:TypeArguments="x:Double" iOS="28" Android="28"  />
    </OnIdiom.Tablet>
</OnIdiom>

The attachable property Phone was not found in type OnIdiom.

And I also get another warning here:

<Thickness x:Key="pageContentPadding">10,0,10,0</Thickness>

The type 'Thickness' does not support direct content.

I've used these styles since the beginning of the app with no warning, until now.
How should I change them now?

Tagged:

Answers

  • adrianex03adrianex03 Member ✭✭
    Did you find a fix for it?
  • stesvisstesvis USMember ✭✭✭

    Hi @adrianex03 this doesn't give me any warnings now:

    <OnIdiom x:Key="largeFontSize" x:TypeArguments="x:Double" Phone="23" Tablet="28"></OnIdiom>
    and

                <Thickness x:Key="pageContentPadding">
                    <Thickness.Left>10</Thickness.Left>
                    <Thickness.Top>0</Thickness.Top>
                    <Thickness.Right>10</Thickness.Right>
                    <Thickness.Bottom>0</Thickness.Bottom>
                </Thickness>
    
  • MikilllMikilll Member ✭✭✭

    VS upgraded to version 15.7 shows all occurrences of "OnIdiom" in XAML as an error. However, the code compiles successfully, so it is just a bug in Intellisense behavior.

    Also, this error message is wrong.

    The attachable property Phone was not found in type OnIdiom.
    

    Because we are not setting the attached property of "OnIdiom" but just a normal property.

Sign In or Register to comment.