WPF Validation ErrorTemplate for Custom TextBox

前端 未结 1 1939
时光取名叫无心
时光取名叫无心 2021-02-06 09:50

Branching off of this question -

When attaching a validation error template to my custom textbox like this -



        
1条回答
  •  不要未来只要你来
    2021-02-06 10:16

    Alright so the way I managed to fix the issue was by removing the AdornedElement keyword and changing the error template as follows:

    
        
            
                
                    
                        
                    
                    !
                
            
        
        
            
        
    
    

    What I don't understand is why it behaves differently when using the AdornedElement keyword but works fine when binding the Tag/Tooltip using the RelativeSource. While the problem is solved, I would welcome any ideas as to why this happened.

    Thanks

    0 讨论(0)
提交回复
热议问题