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

When setting the property ShowClearButton="True" for the control hc:TextBox, Click on the Clear button throws an exception. #131

Closed
steveyan00 opened this issue Mar 16, 2022 · 1 comment

Comments

@steveyan00
Copy link

steveyan00 commented Mar 16, 2022

Describe the bug
When setting the property ShowClearButton="True" for the control hc:TextBox, Click on the Clear button throws an exception.

To Reproduce
Steps to reproduce the behavior:

  1. <hc:TextBox ShowClearButton="True" Text={Binding Variable} />
  2. Click the Clear button and enter something.
  3. 7 : ConvertBack cannot convert value '' (type 'String'). BindingExpression:Path=AIntVariable; DataItem='MainViewModel' (HashCode=xxxxxxxx); target element is 'TextBox' (Name=''); target property is 'Text' (type 'String') FormatException:'System.FormatException: Input string was not in a correct format.

Expected behavior
Add a judgment for the empty string. The value can be set to 0 if it is empty.

Screenshots
image
image
image
image

Environment (please complete the following information):

  • .net: 6.0
  • IDE vs2022
  • Version 3.3.11

ps: The above is translated from DeepL.

@steveyan00 steveyan00 changed the title When setting the property TextType="Int" for the control hc:TextBox, empty string input will cause an exception. When setting the property ShowClearButton="True" for the control hc:TextBox, Click on the Clear button throws an exception. Mar 17, 2022
@ghost1372
Copy link
Owner

#48

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

2 participants