如何在 F# 中为 Xamarin.Forms 创建自定义渲染器
How to create a custom renderer in F# for Xamarin.Forms
我不知道把这行放在哪里:
[<assembly: ExportRenderer (typeof<TransitoCDMX.Main.FbLoginPage>, typeof<FbLoginPageRenderer>)>] do()
在C#中通常这样放在命名空间之前:
[assembly: ExportRenderer (typeof(TransitoCDMX.Main.FbLoginPage), typeof(FbLoginPageRenderer))]
-"The problem is that in F# you can't reference a type that hasn't been declared. On C# you would place the assembly attribute right before the namespace where the custom renderer is defined."
-"So place it in a separate file that comes after the definition. Or place it in the same file right after the definition. I don't see a problem."
https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/attributes
我不知道把这行放在哪里:
[<assembly: ExportRenderer (typeof<TransitoCDMX.Main.FbLoginPage>, typeof<FbLoginPageRenderer>)>] do()
在C#中通常这样放在命名空间之前:
[assembly: ExportRenderer (typeof(TransitoCDMX.Main.FbLoginPage), typeof(FbLoginPageRenderer))]
-"The problem is that in F# you can't reference a type that hasn't been declared. On C# you would place the assembly attribute right before the namespace where the custom renderer is defined."
-"So place it in a separate file that comes after the definition. Or place it in the same file right after the definition. I don't see a problem."
https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/attributes