Xaml Xamarin';s执行平台上静态资源绑定的新方法

Xaml Xamarin';s执行平台上静态资源绑定的新方法,xaml,xamarin,xamarin.forms,static-binding,Xaml,Xamarin,Xamarin.forms,Static Binding,以前我能做这样的事情 <OnPlatform x:TypeArguments="Color" Android="{StaticResource Primary}"/> 我的语法应该是怎样的?因为StaticResource是一个标记扩展,您可以通过 例如,尝试以下方法: <OnPlatform x:TypeArguments="Color"> <On Platform="Android" Value="{StaticResource Primary}" /

以前我能做这样的事情

<OnPlatform x:TypeArguments="Color" Android="{StaticResource Primary}"/>

我的语法应该是怎样的?

因为
StaticResource
是一个标记扩展,您可以通过

例如,尝试以下方法:

<OnPlatform x:TypeArguments="Color">
    <On Platform="Android" Value="{StaticResource Primary}" />
</OnPlatform>

或者


Cannot convert "{StaticResource Primary}" into Xamarin.Forms.Color
<OnPlatform x:TypeArguments="Color">
    <On Platform="Android" Value="{StaticResource Primary}" />
</OnPlatform>
<OnPlatform x:TypeArguments="Color">
    <On Platform="Android">
         <StaticResource Key="Primary" />
    </On>
</OnPlatform>