TabItem should be defined as follows:
<TabItem Header="Foo">
<Border>
<AdornerDecorator>
<Grid>
<TextBox Height="35" >
<TextBox.Text>
<Binding Path="pan_id" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<ps:PanIdValidation />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</Grid>
</AdornerDecorator>
</Border>
</TabItem>
The issue is, the Validation.Error cues are painted in the Adorner Layer. When you switch tabs, that layer is discarded.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…