Attached event not fire upon the first load
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
[Here is a minimal reproduction project](https://github.com/user-attachments/files/16778838/AttachedEventNotFire.zip)
The UI structure is `TabItem > StackPanel > TextBox`. When the property bound to TextBox gets a validation error, the validation state should be reported to the direct parent StackPanel and then TabItem. But the Validation.Error event did not fire upon the first time adding the content to UI.
### Reproduction Steps
After setting up, click the bottom Button with "Add Content". This will load a view model (ViewModel class instance with validation errors) and apply DataTemplate before rendering on UI.
The Validation rules are: all the three int properties A, B, C should be larger than zero and C = A-B.
From the debug information printed in the output console, you'll find that Validation.Error was not fired.
But after that, if you change the second TextBox under the first TabItem to a negative value, you'll see the Validation.Error bubbled as expected: TextBox-> StackPanel->TabItem.
### Expected behavior
Attached event (Validation.Error) should fire upon the first load
### Actual behavior
Attached event (Validation.Error) did not fire upon the first load
### Regression?
_No response_
### Known Workarounds
_No response_
### Impact
_No response_
### Configuration
_No response_
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.