CommunityToolkit / CommunityToolkit/dotnet

Usage of ObservableValidator in Windows Template Studio

Open
#26 28 comments 0 reactions 0 assignees View on GitHub
mvvm-toolkit :toolbox: question :grey_question:
Dominant language
C#
Stars
3.8k
Forks
400
PR merge metrics
No merged PRs in 30d

Description

Hi

We are working on a Mockup for WinUI3 Templates in Windows Template Studio that uses the MVVMToolkit libraries.
You can find the code at [Mockup-WinUI3](https://github.com/microsoft/WindowsTemplateStudio/tree/Mockup-WinUI3).

As part of this mockup we're looking at a FormPage that allows users to add a new order to an in-memory SampleOrder Collection.
We want to validate the user input and give visual feedback when the user edits any of the fields and when clicking submit.

We initially implemented a custom ValidationObservableRecipient and want to switch to the MVVMToolkit ObservableValidator now.
You can find a sample implementation of the old page in FormPage and the new implementation in the FormWCTPage.

We are having some issues in the new FormWCTPage:

- The OrderId does not always remove the error message when a correct value is entered.
- We did not find a way to validate and show visual feedback on the fields to the user when clicking submit button (for example: leave all fields empty and click submit)
- We did not find a way to reset the fields to the default values after submitting

Are we missing something or are those scenarios not yet supported?

**Screenshots of Form Page**

![image](https://user-images.githubusercontent.com/5556784/99552353-333b1580-29bd-11eb-85c0-3c10d6fe8109.png)

Clicking directly on submit button

![image](https://user-images.githubusercontent.com/5556784/99552445-4d74f380-29bd-11eb-8dc4-bfb2f9626a64.png)

Thank you so much ;)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.