Gu.Wpf.ValidationScope icon indicating copy to clipboard operation
Gu.Wpf.ValidationScope copied to clipboard

`Scope.Errors` incorrect when set one invalid `TextBox` invisible

Open mzh3511 opened this issue 2 years ago • 0 comments

Can not get correct errors when 1 textbox set to invisible

Hello, I found that Scope.Errors is incorrect when setting one invalid TextBox invisible if there are more than 1 invalid TextBox

  1. Add a button to visible or invisible DoubleTextBox in the Gu.Wpf.ValidationScope.Demo.OneLevelScopeView, the button event method code:
    private void BtnEnable_OnClick(object sender, RoutedEventArgs e)
    {
        if (DoubleTextBox.Visibility == Visibility.Visible)
            DoubleTextBox.Visibility = Visibility.Collapsed;
        else
            DoubleTextBox.Visibility = Visibility.Visible;
    }
  1. Input English letters in both IntTextBox2 and DoubleTextBox Expect: Get 2 errors, both IntTextBox2 and DoubleTextBox have the red box Actual: Same with expect

  2. Click the button to set the DoubleTextBox Collapsed Expect: Get 1 error, IntTextBox2 has the red box, DoubleTextBox disappear Actual: Get zero error, IntTextBox2 has the red box, DoubleTextBox disappear

  3. Click the button again to set the DoubleTextBox Visible Expect: Get 2 errors, both IntTextBox2 and DoubleTextBox have the red box Actual: Get 1 error, both IntTextBox2 and DoubleTextBox have the red box

Can you help me? thanks

mzh3511 avatar Jan 05 '24 04:01 mzh3511