我正在使用 Formflow 生成必要的问题,以便从用户那里获取所有数据。由于我支持多种语言,我不能只使用属性。所以我阅读了它并注意到 RView 可用于生成资源文件。但是,由于我已经对资源文件进行了拆分和排序,因此我正在尝试重用它们。
使用 FieldReflector,我可以很容易地做到这一点
form.Field(new FieldReflector<HolidayPlanningFlowForm>(nameof(StartDate),true)
.SetType(typeof(string))
.SetFieldDescription(Resources.HolidayResources.Planning_FlowStartDate_Describe)
.SetPrompt(new PromptAttribute(Resources.HolidayResources.Planning_FlowStartDate_Prompt)));
很好。但我不知道在哪里为 TemplateUsage.NotUnderstood 或 TemplateUsage.DateTimeHelp 定义模板。在参考文献中,Field 上有一个可用的方法 ReplaceTemplate(),但是这个反射器返回一个 IField,无法弄清楚如何让它工作。
任何人都有最好的选择(我真的不想使用 RView ;))