Skip to content

Commit 94f2ef8

Browse files
authored
解决控件验证没有错时xaml 绑定报错
报错为:AdornedElementPlaceholder, Name='adornedElementPlaceholder' AdornedElement.(0)[0].ErrorContent TextBlock.Text String Failed to get value. ArgumentOutOfRangeException:'System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index')'
1 parent a7f0a9f commit 94f2ef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Shared/HandyControl_Shared/Themes/Styles/Base/BaseStyle.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</Grid.RowDefinitions>
5151
<AdornedElementPlaceholder x:Name="adornedElementPlaceholder" />
5252
<hc:TransitioningContentControl TransitionMode="Top2Bottom" Grid.Row="1" ClipToBounds="True">
53-
<TextBlock Foreground="{DynamicResource DangerBrush}" Margin="2,2,0,0" Text="{Binding Path=AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=adornedElementPlaceholder}" />
53+
<TextBlock Foreground="{DynamicResource DangerBrush}" Margin="2,2,0,0" Text="{Binding Path=AdornedElement.(Validation.Errors)/ErrorContent, ElementName=adornedElementPlaceholder}" />
5454
</hc:TransitioningContentControl>
5555
</Grid>
5656
</ControlTemplate>

0 commit comments

Comments
 (0)