0
J'essaie de changer de style dans une zone de texte. Maintenant, je l'ai fait que mon champ de saisie montre une asterisc à droite de sa frontière avec ce code:Stylisation d'un TextBox avec IDataErrorInfo dans WPF
<Style TargetType="{x:Type TextBox}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<Grid>
<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Foreground="Red" FontSize="14pt" FontWeight="Bold" Text="*"></TextBlock>
<Border BorderBrush="Red" BorderThickness="1">
<AdornedElementPlaceholder Name="controlWithError"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding Path=(Validation.Errors)[0].ErrorContent}"/>
</Trigger>
</Style.Triggers>
</Style>
Mais je voudrais ma zone de texte affiché avec un triangle rouge sur le coin supérieur droit. Comment pourrais-je obtenir ce style sur ma zone de texte?
Merci.