C# Xamarin表单自定义单元格货币格式?
我有一个自定义的FiancialCell,它可以工作,但不能格式化为货币。是否有其他方法更改绑定格式,使其为$C# Xamarin表单自定义单元格货币格式?,c#,ios,visual-studio,xamarin,xamarin.forms,C#,Ios,Visual Studio,Xamarin,Xamarin.forms,我有一个自定义的FiancialCell,它可以工作,但不能格式化为货币。是否有其他方法更改绑定格式,使其为$ public FinancialCell() { ....... //Set the bindings to the FinancialRow object to be bound to this lblTitle.SetBinding(Label.TextProperty, "Title"); /
public FinancialCell()
{
.......
//Set the bindings to the FinancialRow object to be bound to this
lblTitle.SetBinding(Label.TextProperty, "Title");
///Why does this not format to $ when displayed?
lblValue.SetBinding(Label.TextProperty, "Value", stringFormat: "C");
this.View = stack;
}
改用“{0:C}”
,它就会工作
以下是与修复程序集成的示例,仅为完整起见:-
public FinancialCell()
{
.......
//Set the bindings to the FinancialRow object to be bound to this
lblTitle.SetBinding(Label.TextProperty, "Title");
///Why does this not format to $ when displayed?
lblValue.SetBinding(Label.TextProperty, "Value", stringFormat: "{0:C}");
this.View = stack;
}