ReSharper Warning : Invalid type: expected type is 'double', actual type is 'OnPlatfrom'

ramanan.sambandamramanan.sambandam ✭✭USMember ✭✭
edited May 2017 in Xamarin.Forms

Hi

I'm getting ReSharper warning in my XAML file as Invalid type: expected type is 'double', actual type is 'OnPlatfrom'.

I have changed my code from old (deprecated) method

<OnPlatform x:TypeArguments="x:Double" iOS="60" Android="40" WinPhone="40" />

To

<OnPlatform x:TypeArguments="x:Double">
    <On Platform="iOS" Value="60" />
    <On Platform="Android" Value="40" />
    <On Platform="WinPhone" Value="40" />   
</OnPlatform>

One main problem is that its not accepting the changes. So I revert back to the old one to make it work out.

I don't know its a valid warning. Correct me if I made anything wrong or tell me some solution. Thanks.

Answers

  • candidodmvcandidodmv ✭✭ BRMember ✭✭

    I'm getting the same message, as you said, this can be a issue of ReSharper

  • HemalathaMarikumarHemalathaMarikumar ✭✭ USMember ✭✭

    Hi @ramanan.sambandam

    How did you give the int values in OnPlatform. I have custom control with custom properties Like Index that value should be changed based on platform. Hence i have code example like

    <OnPlatform x:TypeArguments="x:Int" iOS="1" Android="1" WinPhone="7" />
    

    But it throws error like Type int is not found.

    Can you please give your solution to resolve this issue?

    Regards,
    @HemalathaMarikumar

Sign In or Register to comment.