Bonjour,
Je rencontre un problème de positionnement d'un userControl dans un TextBlock.
Lorsque je code comme ceci : pas de problème l'hyperlien est bien positionné à la suite du texte du TextBlock.
<TextBlock Grid.Column="1" Grid.Row="2" FontFamily="Segoe UI" FontSize="14" FontWeight="Bold" HorizontalAlignment="Left"
Height="20" Width="Auto" VerticalAlignment="Top" Text="UN TEXTE">
<Hyperlink Foreground="Black" OverridesDefaultStyle="True" MouseEnter="Hyperlink_MouseEnter"
MouseLeave="Hyperlink_MouseLeave" FontFamily="Segoe UI" FontSize="14" FontWeight="Bold" >MON LIEN</Hyperlink>
</TextBlock>
Par contre si je crée un usercontrol contenant l' HyperLien comme ceci :
<UserControl x:Class="MonLien"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Hyperlink FontFamily="Segoe UI" FontSize="14" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top"
VerticalContentAlignment="Top" Height="20">UN LIEN</Hyperlink>
</UserControl>
et que je l'insère dans mon textbloc comme ceci :
<TextBlock Grid.Column="1" Grid.Row="2" FontFamily="Segoe UI" FontSize="14" FontWeight="Bold" HorizontalAlignment="Left" Height="20"
Width="Auto" VerticalAlignment="Top" Text="UN TEXT">
<my:MonLien />
</TextBlock>
L'hyperlien s'affiche bien à la suite du text mais plus haut comme le montre la copie d'écran suivante :
http://www.hostingpics.net/viewer.php?id=912806Capture.png
Merci d'avance pour votre aide.
TEDFR