I have a user control with a control pattern displaying validation errors, validation pattern:
<ControlTemplate x:Key="TextBoxPropertyValidationTemplate"> <StackPanel> <Border BorderBrush="Red" BorderThickness="1"> <AdornedElementPlaceholder x:Name="MyAdorner" /> </Border> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image Grid.Column="0" MaxHeight="16" MaxWidth="16" Source="{Binding Source={StaticResource ValidationIcon}, Converter={StaticResource UriConverter}}" Margin="1" RenderOptions.BitmapScalingMode="HighQuality" VerticalAlignment="Center" HorizontalAlignment="Center" /> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding ElementName=MyAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap" Grid.Column="1" FontSize="10" Foreground="Red" /> </Grid> </StackPanel> </ControlTemplate>
And I can't get around a rather annoying problem that looks like this:

I try to play with the fields in a user control, and the template also has the value Height = Auto, etc., but all this does not help. Any ideas anybody?
If this helps the main user control (which nests with validation) is in TabItem with AdornerDecorator.
Any help was appreciated.
source share