Commit 2e67fcd
authored
Feature Add Validation to ReactiveProperty (#3777)
<!-- Please be sure to read the
[Contribute](https://github.com/reactiveui/reactiveui#contribute)
section of the README -->
**What kind of change does this PR introduce?**
<!-- Bug fix, feature, docs update, ... -->
Feature for #3771
**What is the current behavior?**
<!-- You can also link to an open issue here. -->
ReactiveProperty has basic functionality
**What is the new behavior?**
<!-- If this is a feature change -->
ReactiveProperty now supports Validation through INotifyDataErrorInfo
AddValidation and AddValidationError methods added to attach the
ReactiveProperty to the Validation mechanism
CheckValidation and Refresh exist to re-evaluate the Validation
```c#
MyReactiveProperty = new ReactiveProperty<string>()
.AddValidation(() => MyReactiveProperty)
.AddValidationError(s => string.IsNullOrWhiteSpace(s) ? "required" : null);
```
**What might this PR break?**
None expected.
**Please check if the PR fulfills these requirements**
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
**Other information**:1 parent 095a9c9 commit 2e67fcd
File tree
16 files changed
+1186
-29
lines changed- src
- ReactiveUI.Tests
- API
- Properties
- ReactiveProperty
- Mocks
- ReactiveUI/ReactiveProperty
16 files changed
+1186
-29
lines changedLines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
354 | 356 | | |
| 357 | + | |
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
| |||
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
756 | 764 | | |
757 | | - | |
| 765 | + | |
758 | 766 | | |
759 | 767 | | |
760 | 768 | | |
761 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
762 | 772 | | |
| 773 | + | |
| 774 | + | |
763 | 775 | | |
764 | 776 | | |
765 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
766 | 786 | | |
767 | 787 | | |
| 788 | + | |
| 789 | + | |
768 | 790 | | |
769 | 791 | | |
770 | 792 | | |
| |||
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
354 | 356 | | |
| 357 | + | |
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
| |||
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
756 | 764 | | |
757 | | - | |
| 765 | + | |
758 | 766 | | |
759 | 767 | | |
760 | 768 | | |
761 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
762 | 772 | | |
| 773 | + | |
| 774 | + | |
763 | 775 | | |
764 | 776 | | |
765 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
766 | 786 | | |
767 | 787 | | |
| 788 | + | |
| 789 | + | |
768 | 790 | | |
769 | 791 | | |
770 | 792 | | |
| |||
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
354 | 356 | | |
| 357 | + | |
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
| |||
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
756 | 764 | | |
757 | | - | |
| 765 | + | |
758 | 766 | | |
759 | 767 | | |
760 | 768 | | |
761 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
762 | 772 | | |
| 773 | + | |
| 774 | + | |
763 | 775 | | |
764 | 776 | | |
765 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
766 | 786 | | |
767 | 787 | | |
| 788 | + | |
| 789 | + | |
768 | 790 | | |
769 | 791 | | |
770 | 792 | | |
| |||
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
352 | 354 | | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
751 | 754 | | |
752 | 755 | | |
753 | 756 | | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
754 | 762 | | |
755 | | - | |
| 763 | + | |
756 | 764 | | |
757 | 765 | | |
758 | 766 | | |
759 | | - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
760 | 770 | | |
| 771 | + | |
| 772 | + | |
761 | 773 | | |
762 | 774 | | |
763 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
764 | 784 | | |
765 | 785 | | |
| 786 | + | |
| 787 | + | |
766 | 788 | | |
767 | 789 | | |
768 | 790 | | |
| |||
0 commit comments