TextBox を含む XAML ウィンドウがあり、この TextBox には ErrorTemplate があります。
ErrorTemplate を以下に示します。ご覧のとおり、AdornedElementPlaceholder があり、その後にテキスト フィールドが ErrorContent にバインドされたテキスト ボックスが続きます。
<ControlTemplate x:Key="ValidationErrorTemplateTextBlock" TargetType="{x:Type Control}">
<Border BorderBrush="Red" BorderThickness="1">
<StackPanel Orientation="Vertical">
<AdornedElementPlaceholder Name="AdornedElementPlaceholder" />
<TextBlock Text="{Binding ElementName=AdornedElementPlaceholder, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"
FontSize="10"
Background="Red"
Foreground="White"
Padding="2" />
</StackPanel>
</Border>
</ControlTemplate>
<TextBox IsEnabled="{Binding SendMessage}"
Text="{Binding AutoMessageSubject, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource StyleBase}"
Validation.ErrorTemplate="{StaticResource ValidationErrorTemplateTextBlock}"
HorizontalAlignment="Stretch"
Grid.Row="3"
Grid.Column="1"
Grid.ColumnSpan="2" />
TextBox が GridRow 内にあり、Height="Auto" であることを除いて、これは正常に機能します。行はテキストボックスに基づいて自動的にスケーリングされますが、ErrorTemplate が表示され、下部に追加の TextBox が表示されると、GridRow は新しい TextBox を含むように拡大されず、新しい TextBox はその下の要素に重なります。
どうすればこれを解決できますか?