Ian*_*ink 2 c# visual-studio ios xamarin xamarin.forms
我有一个定制的FiancialCell,但不会格式化为货币.是否有另一种方法来更改绑定格式,以便它是$?
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;
}
Run Code Online (Sandbox Code Playgroud)
"{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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3035 次 |
| 最近记录: |