小编Bra*_*ipp的帖子

如何将Xamarin.Forms条目绑定到非字符串类型,例如Decimal

我创建了Entry,我试图将它绑定到Decimal属性,如下所示:

var downPayment = new Entry () {
    HorizontalOptions = LayoutOptions.FillAndExpand,
    Placeholder = "Down Payment",
    Keyboard = Keyboard.Numeric
};
downPayment.SetBinding (Entry.TextProperty, "DownPayment");
Run Code Online (Sandbox Code Playgroud)

当我尝试在模拟器上输入Entry时,我收到以下错误.

对象类型System.String无法转换为目标类型:System.Decimal

c# xamarin xamarin.forms

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

xamarin ×1

xamarin.forms ×1