Salut a tous,
Je re-developpe en wpf avec mvvm light une vielle application que j'avais faite en winforms.
Le soucis est que j'ai à un moment une lisbox qui contient des expander qui contiennent eux-même une listbox.
Quand je déroule un expander, le scroll se fait en "block", c'est a dire qu'il scroll toute la listbox contenue dans l'expander en un saut, a la place de scroller "élément par élément" la listbox dans l'expander :/
(Avant dans le codebehind je générais des label dans un stackpanel contenu dans l'expander et non une listbox dans l'expander)
Voici le code de mon user control :
Code xaml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <UserControl x:Class="MHelper.View.SummaryView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <ListBox ItemsSource="{Binding MainSections}" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <Expander Header="{Binding MainSectionName}" > <ListBox ItemsSource="{Binding SectionList}" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <Label Content="{Binding SectionName}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Expander> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> </UserControl>
Merci d'avance ^^
Inform@tiquement
Istace Emmanuel
Partager