简体   繁体   中英

Control validation in wpf which is inside a resource style C#

I'm using navigation window in wpf which has a style applied on it. Inside that style there are textboxes. I use MVVM pattern and my model implements IDataErrorInfo and returns error for these textboxes. Everything releated to data binding works just fine, but validation highlighting fails. There is no problem with styles, I have set special style for validation error for these textboxes. When I use the same not inside resource, then valdiation works correct.

You need to make sure your Style is an implicit style so it gets applied to your TextBoxes. If you have an x:Key on your style, then remove it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM