Bonjour,

J'ai un problème, j'ai un textblock qui contient un long texte, et je souhaiterais qu'il fasse des retours à la lignes automatiquement en fonction de la taille de la fenêtre.

Comment faire ?
J'utilise une page principale, qui a une frame. Et que je modifie le contenu de l'iframe, en mettant un contrôle à la place. J'ai pris cette méthode à partir d'ici http://badger.developpez.com/tutorie...-le-meme-code/

Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
<Window x:Class="mynamspace.MainGame"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainGame"  Height="600" Width="800" Loaded="Window_Loaded">
    <Grid>
        <Frame x:Name="NavigationFrame" 
               NavigationUIVisibility="Hidden" 
               HorizontalAlignment="Stretch" 
               VerticalAlignment="Stretch">
        </Frame>
    </Grid>
</Window>

Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
<UserControl x:Class="myView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Background="AliceBlue">
    <StackPanel>
        <TextBlock VerticalAlignment="Bottom" Width="Auto" Text="{Binding Path=myCar.Text}" Height="Auto" FontSize="75" />
    </StackPanel>
</UserControl>

Merci