Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
Restrict input
posted
Hi is it possible to restrict somehow input on XamTextEditors.. When i set the regex pattern the user is still able to write different characters, but the control won't allow him to leave it.. I would like control to forbid user to input characters which are not stated in regex.. Or is it only possible with masked editors?.. Thank you
Parents
  • 2070
    posted

     Hi,

     

    XamTextEditor will validate the input when the user leaves the editor and will take action, like display an error message box, based on its InvalidValueBehavior setting. However it will not restrict the user from typing any characters. BTW, editors expose IsValueValid property that is updated on every character input to reflect whether the current entered value is valid or not. You can for example use that in xaml in a trigger to highlight the editor differently etc... when the value is invalid.

     

    Hope this helps,

    Sandip 

Reply Children