Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Xamarin表单自定义单元格货币格式?_C#_Ios_Visual Studio_Xamarin_Xamarin.forms - Fatal编程技术网

C# Xamarin表单自定义单元格货币格式?

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"); /

我有一个自定义的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;
    }
改用
“{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;
    }