f# - 如何在 F# 中为 Xamarin.Forms 创建自定义渲染器

标签 f# xamarin.forms customization

我不知道该在哪里放置这一行:

[<assembly: ExportRenderer (typeof<TransitoCDMX.Main.FbLoginPage>, typeof<FbLoginPageRenderer>)>] do()

在 C# 中,它通常以这种方式放置在命名空间之前:

[assembly: ExportRenderer (typeof(TransitoCDMX.Main.FbLoginPage), typeof(FbLoginPageRenderer))]

最佳答案

-“问题在于,在 F# 中,您无法引用尚未声明的类型。在 C# 中,您可以将程序集属性放在定义自定义渲染器的命名空间之前。”

-“所以将其放在定义之后的单独文件中。或者将其放在定义之后的同一个文件中。我没有发现问题。”

https://learn.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/attributes

关于f# - 如何在 F# 中为 Xamarin.Forms 创建自定义渲染器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40332957/

相关文章:

interop - 动态导入 C/C++ DLL

c# - 如何在 Xamarin.Forms 的选项卡式页面中的页面之间共享值?

android - 如何在 Sherlock 选项卡 View 中删除填充

jsf - 自定义 h :selectOneRadio with other components 的布局和标签

visual-studio - 让 Visual Studio 在按下 Ctrl 和光标键时理解 CamelCase

.net-core - FSharp 出现错误 : error FS0192 the anonymous record <>f__AnonymousType has not been generated in the pre-phase of generating this module

recursion - F# 如何展平二叉搜索树

f# - 使用标准输入初始化函数

azure - 将 Azure 移动服务与 Xamarin Forms 结合使用的正确方法?

xaml - XAML 资源字典中的算术运算