获取“调用目标引发了异常”。在自定义控件中

时间:2017-04-30 03:54:15

标签: xamarin xamarin.ios xamarin.forms

我在Xamarin跨平台创建了自定义输入控件。但不知道为什么会有例外。我在哪里做错了?

这是我的代码

CustomEntry.cs

public class CustomEntry : Entry
    {
        public static readonly BindableProperty cornerRadiusProperty = BindableProperty.Create("Radius",typeof(double),typeof(CustomEntry),0);
        public double CornerRadius { 
            get { return (double)GetValue(cornerRadiusProperty);}
            set { SetValue(cornerRadiusProperty, value);  }
        }
    }

MyXaml Page

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:cl="clr-namespace:customcontrolapp;assembly=customcontrolapp" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    x:Class="customcontrolapp.MyXaml" >
    <ContentPage.Content>
        <cl:CustomEntry Text="Sample" />
    </ContentPage.Content>
</ContentPage>

1 个答案:

答案 0 :(得分:0)

我已将此异常更改链接器选项链接全部解析为仅仅SDK链接。 感谢