Click here to Skip to main content
15,936,758 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Ola muy buenas tardes saben estoy desarrollando una pequeña aplicacion en wpf y una validacion sencilla lo que quiero es que cuando el control no satisfaga la validacion no se quite el foco del control por mas que el usuario haga click en otro control haci obligar que no salga del control hasta que introdusca unos valores correctos

Esto en Windows Forms se logra atraves de el evento validating que utiliza la clase CancelEventArgs y con la intruccion e.Cancel=true; pues se blokea que el foco avanse al siguiente control

el problemas es que los controles de WPF no tiene el evento Validating para usar esa clase gracias por su atención


Translation:

a very good afternoon know I'm developing a small application in WPF and a simple validation what I want is that when the control does not satisfy the validation do not remove the focus of the control by more than the user click on another control to force that does not leave L control until insert a correct values

This in Windows forms is achieved through the validating event that uses the CancelEventArgs class and with the instruction E. Cancel = true; For it is blokea that the focus Avanse to the next control

The problem is that WPF controls don't have the validating event to use that class thank you for your attention

Change the RountedEventArgs by the CancelEventArgs but I bounce error

What I have tried:

cambiar el RountedEventArgs por el CancelEventArgs pero me bota error
Posted
Updated 12-Nov-17 0:29am
v2

1 solution

Have a look at these Code project articles
Validation in WPF[^]

Simple Validation in WPF[^]
Don't forget to allow the user to just give up and cancel or exit. There is nothing worse in terms of user experience than being "trapped" in a page
 
Share this answer
 
Comments
Joab Svante Huanca Llave 12-Nov-17 11:32am    
GRASIAS POR COMENTAR REVISARE LA DOCUMENTACION

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900