xamarin/Xamarin.Forms

[Xaml] Missing platform/idiom value in OnPlatform/OnIdiom causes ArgumentNullException when type is x:BindingBase

开放

#5,629 创建于 2019年3月20日

 (0 条评论) (2 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/Xaml </>a/binding ⛓e/2 :clock2:good first issuehelp wantedinactivet/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Description

Missing platform/idiom value in OnPlatform/OnIdiom causes ArgumentNullException when type is x:BindingBase.

Steps to Reproduce

  1. for example: <StackLayout> <StackLayout.IsEnabled> <OnPlatform x:TypeArguments="BindingBase" iOS="{Binding Source=False}"/> </StackLayout.IsEnabled> </StackLayout>

  2. run it on any non-iOS platform.

Expected Behavior

don't try to set any binding or value for IsEnabled on any other platform than iOS.

Actual Behavior

[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null. Parameter name: binding at (wrapper dynamic-method) System.Object.7(intptr,intptr,intptr) at (wrapper native-to-managed) System.Object.7(intptr,intptr,intptr)

Basic Information

  • Version with issue: 3.6.0
  • IDE: VS 15.9.8
  • Platform Target Frameworks: Xamarin.Forms

贡献者指南