WPF - ListView in ListView Scrollbar Function

So, currently I have a ListView "List A", each of which has an expander control that contains another ListView "List B". The problem I am running into is that sometimes List B gets so big that it goes beyond the scope of List A. The scrollbar list does not reflect the fact that parts of List B are not showing. Is there a way to set up my xaml so that the scrollbars for list A detect when the list inside the expander is longer than the viewport of list A.

Here is the section of code I need to change:

<TabItem Header="Finished">
            <TabItem.Resources>
                <ResourceDictionary>

                        <DataTemplate x:Key="EpisodeItem">
                            <DockPanel Margin="30,3">
                                <TextBlock Text="{Binding Title}" DockPanel.Dock="Left" />
                                <WrapPanel Margin="10,0" DockPanel.Dock="Right">
                                    <TextBlock Text="Finished at: " />
                                    <TextBlock Text="{Binding TimeAdded}" />
                                </WrapPanel>
                            </DockPanel>
                        </DataTemplate>

                        <DataTemplate x:Key="AnimeItem">
                            <DockPanel Margin="5,10">
                                <Image Height="75" Width="Auto" Source="{Binding ImagePath}" DockPanel.Dock="Left" VerticalAlignment="Top"/> 
                                <Expander Template="{StaticResource AnimeExpanderControlTemplate}" >
                                    <Expander.Header>
                                        <TextBlock FontWeight="Bold" Text="{Binding AnimeTitle}" />
                                    </Expander.Header>

                                        <ListView ItemsSource="{Binding Episodes}" ItemTemplate="{StaticResource EpisodeItem}" BorderThickness="0,0,0,0" />

                                </Expander>
                            </DockPanel>                            
                        </DataTemplate>                         
                    </ResourceDictionary>           
            </TabItem.Resources>

            <ListView Name="finishedView" ItemsSource="{Binding UploadedAnime, diagnostics:PresentationTraceSources.TraceLevel=High}" ItemTemplate="{StaticResource AnimeItem}" />                  
</TabItem>

      

List A is a ListView named "finishedView" and List B is a ListView with an ItemSource "Episodes"

+2


a source to share


1 answer


** Edit. Clean up my earlier answer, since you are dealing with a list of individual elements, it is better to use ListBox

and let it handle the content on its own.



0


a source







All Articles