Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Sample: Client-side data validation for user input #21

Closed
bricelam opened this issue May 17, 2015 · 10 comments
Closed

New Sample: Client-side data validation for user input #21

bricelam opened this issue May 17, 2015 · 10 comments

Comments

@bricelam
Copy link

It would be great to see a sample demonstrating the new ValidationErrors property along with its companion properties ValidationState, ValidationIndicatorStyle & IsValidationIndicatorEnabled.

It would also be good to see how it integrates with ValidationAttribute and IValidatableObject.

@h82258652
Copy link

I need this demo too. I saw this feature on msdn, but there have not any documents.

@bricelam
Copy link
Author

@h82258652 I looked more into it on VS 2015 RC, and the properties aren't even available. But, as you said, it's mentioned in What’s new for developers in Windows 10.

@h82258652
Copy link

@bricelam
Thanks, I can not find these classes on VS 2015 RC either. But I had been seen them on VS 2015 CTP6. Maybe MS remove this feature now?
Hopefully this feature can come back in the official Win 10 version. Validate input is necessary. Just like the model validation in asp.net mvc.

@bricelam
Copy link
Author

FYI, patterns & practices has some good guidance on implementing validation yourself, but it will sure be nice to have it built in.

@h82258652
Copy link

Emm, great article. But I think this:

<TextBox x:Name="FirstNameValue"
         Grid.Row="2"
         Text="{Binding UserInfo.FirstName, Mode=TwoWay}">
    <interactivity:Interaction.Behaviors>
        <quickstartbehaviors:HighlightFormFieldOnErrors PropertyErrors="{Binding UserInfo.Errors[FirstName]}" />
    </interactivity:Interaction.Behaviors>

</TextBox>

can be more better. We write "FirstName" twice. The validation system should know what property we are binding.
I found this method on msdn: https://msdn.microsoft.com/en-us/library/ms598124(v=vs.110).aspx
This method is also available in WPF and Windows Runtime.
We pass a dependency property to this method, if this dependency property is binding now, it will return a object which contains binding path, binding source and etc.
Maybe we can use this to build our validation framework.

@AdamBraden
Copy link

This topic is increasing in scope, I've reached out to the owners of this API to respond on this thread specifically about samples in this area. I recommend moving the more in-depth discussion to the Developing Universal Windows apps forum - https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?forum=wpdevelop

@h82258652
Copy link

@AdamBraden
So MS decided to remove this feature?

@bricelam
Copy link
Author

I've reached out to the owners of this API to respond ... about samples in this area.

Thank you.

@timheuer
Copy link
Member

Hi @bricelam thanks for this note. Unfortunately, yes these features for validation will not make it in the final release for Windows 10 right now. We had some good initial feedback from customers that we weren't delivering the expectations and we want more time to get this right before delivering something that wasn't going to meet customers needs primarily. This remains on our backlog for prioritizing against ongoing/new customer requests.

@h82258652
Copy link

@timheuer
Thanks you.
Emm, I‘m trying now, but resolve the binding path to property is difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants