Bonjour;
Je vous expose mon problème ( j'espère que c'est la bonne section ), et avant tout, je tiens à m'excuser si le problème à déjà été résolu, j'ai chercher, et je n'ai pas trouver.
Bon, c'est parti.
Je crée un petit tchat, tout fonctionne bien, excepté une chose... La scrollbar ne suit pas les éléments de la ListBox ( binding ).
J'ai ceci :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <ListBox Height="425" HorizontalAlignment="Left" Margin="255,35,0,0" Name="listBox2" VerticalAlignment="Top" Width="611" Foreground="#FF8D3B05" FontSize="15" BorderBrush="Black" ItemsSource="{Binding ListeMessage}" SelectedItem="{Binding SelectedItem}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,5,0,5"> <TextBlock Foreground="Green" Text="{Binding Date}" /> <StackPanel Orientation="Horizontal"> <TextBlock Foreground="Orange" Text="{Binding Auteur}" /> <TextBlock Foreground="black" Text=" : " /> <TextBlock Foreground="Black" Text="{Binding Message}" /> </StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
J'ai pourtant bien la propriété SelectedItem ( qui normalement, devrais obliger la scrollbar à "descendre'.... Mais rien.
J'ai ceci également :
Code:
1
2 private TMessage _SelectedItem; public event PropertyChangedEventHandler PropertyChanged;
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 public TMessage SelectedItem { get { return _SelectedItem; } set { if (_SelectedItem != value) { _SelectedItem = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("SelectedItem")); } } } }
Y a t'il une propriété pour "forcer" la scrollbar de rester dans le fond? ( mais je dois également pouvoir la remonter pour voir par exemple, des anciens messages )
Merci d'avance pour vos futures réponses.
Et si jamais je me suis tromper de section et/ou que le sujet existait déjà, pas de fessées plz :'(