Since user interface virtualization processes visual containers, it will reset them, so the solution will be to manually bind to some properties in the user control and perform your check in the view model. Then, when it fails the test, change the color and size of the UserControl frame to a red and thicker border.
<UserControl...>
<Grid>
<Border BorderThickness="{Binding Path=Border_Thickness_property}" BorderBrush="{Binding Path=Border_brush_color}">
</Border>
</Grid>
</UserControl>
link: http://www.codeproject.com/Articles/34405/WPF-Data-Virtualization
OR
You could use the View Model to implement IDataErrorInfo and use this interface to define your validation rules.
This site has a nice example.
source
share