Problem with OnPlatform and UWP

EnricoRossiniEnricoRossini USMember ✭✭✭✭
edited December 2017 in Xamarin.Forms

HI guys,
I have a problem with OnPlatform.

<ToolbarItem x:Name="toolbarSave" Command="{Binding SaveWord}" Order="Primary" Priority="0" Text="Save">
    <ToolbarItem.Icon>
        <OnPlatform x:TypeArguments="FileImageSource" UWP="Images/Save.png" />
    </ToolbarItem.Icon>
</ToolbarItem>

The Xamarin.Forms version I'm using is 2.5.0.121934

At Runtime I receive the following error

Cannot assign property "UWP": Property does not exists, or is not assignable, or mismatching type between value and property

UWP Error

Tagged:

Answers

  • MulflarMulflar ESUniversity ✭✭
    edited December 2017

    Hi
    Try with:

    <OnPlatform x:TypeArguments="FileImageSource">
        <On Platform="UWP" Value="Images/Save.png" />
    </OnPlatform>   
    
  • EnricoRossiniEnricoRossini USMember ✭✭✭✭

    I don't have the error now. Later I'm checking if UWP shows an image.
    Thanks!

Sign In or Register to comment.