feature : Multiple validation context support
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- csharp
调研方向
首先检查现有的 ValidationRule(...) 和 BindValidation(...) 方法以及 IValidatableViewModel 验证上下文,然后将它们与 issue 中链接的 proposed multiple_validation_contexts 分支进行比较。完成的标准是,单个 ViewModel 可以支持用于阻止外部进程和独立显示错误的不同验证上下文。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Had a case where i needed to have validations that stop and block an external process and others that simply display the error without blocking or stopping anything. I also needed to display these validations separately.
Describe the solution you'd like
I thinked of having multiple validation contexts in a single ViewModel. To do so I made overloads for the "ValidationRule(...)" and "BindValidation(...)" methods. I added a "Func<TViewModel, ValidationContext> validationContextProperty" parameter to those methods and use it instead of the one present by default in the "IValidatableViewModel" interface.
Describe alternatives you've considered
An alternative could have been to create multiple validation classes inheriting from IValidationComponent but that also means adding methods to add them to the validation context. I would also need to create functions to filter them in order to know if a validation of type x is false.
Describe suggestions on how to achieve the feature
Made modifications of the code of this repo and uploaded everything on this github in the multiple validation context branch.
https://github.com/brignolff/Mdified.ReactiveUI.Vaidation/tree/multiple_validation_contexts
- 主要语言
- C#
- 星标
- 273
- 派生
- 30
- 平均合并
- 4 天 10 小时
- 30 天内合并 PR
- 15
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
reactiveui/ReactiveUI.Validation 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 20/100
reactiveui/ReactiveUI.Validation#634 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
reactiveui/ReactiveUI.Validation#463 · 2 个 reaction ·
维护者通常 3 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
reactiveui/ReactiveUI.Validation#414 · 2 条评论 ·
维护者通常 3 天内回复
-
Performance
难度 3/5 1-2 天 新手友好度 35/100
reactiveui/ReactiveUI.Validation#117 ·
维护者通常 3 天内回复
查看 reactiveui/ReactiveUI.Validation 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
microsoft/vscode-docs#10499 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
python triage
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/semantic-kernel#14615 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
vzeol/DeployCraft#125 ·
维护者通常 1 天内回复