Xamarin Forms 4.11.0错误:找不到UWP的属性,可绑定属性或事件

时间:2019-02-21 18:37:54

标签: c# xaml xamarin xamarin.forms

我从以下xaml中遇到了UWP的奇怪错误:

<sfPager:SfDataPager.HeightRequest>
                <OnPlatform x:TypeArguments="x:Double"  
                  UWP="40"
                  Android="50"
                  iOS="50"/>                 
 </sfPager:SfDataPager.HeightRequest>

编译时出现以下错误:

No property, bindable property, or event found for 'UWP', or mismatching type between value and property.

我在这里做错什么了!!

2 个答案:

答案 0 :(得分:1)

OnPlatform的平台差异:

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

re:Platform Differences with OnPlatform

答案 1 :(得分:1)

<sfPager.SfDataPager HeightRequest="{OnPlatform UWP=40, iOS=50, Android=50}"