Tooltip in validation

Aug 4 2009 5:05 PM

Hello everyone,
I've got the the attached  user control .It's work just fine accept for the fact that I can't see the tooltip.
Can you please tell me what I'm missing?
Thanks' in advance,
Lior
<
UserControl.Resources>
<Style TargetType="{x:Type TextBox}" x:Key="IDValid">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Right" Foreground="Red" FontSize="14" FontWeight="Bold"
ToolTip="{Binding ElementName=Holder,Path=AdornedElement.(Validation.Errors)[0].ErrorContent.ToString()}">!!!</TextBlock>
<Border BorderBrush="Red" BorderThickness="2">
<AdornedElementPlaceholder Name="Holder"></AdornedElementPlaceholder>
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<TextBox Width="{Binding RelativeSource={RelativeSource Self}, Path=Parent.Width}" Height="{Binding RelativeSource={RelativeSource Self}, Path=Parent.Height}"
Style="{StaticResource IDValid}" >
<TextBox.Text>
<Binding ElementName="This" Path="ID" NotifyOnValidationError="True">
<Binding.ValidationRules>
<local:IdValidation />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>

</TextBox>
</
UserControl>

Answers (4)