Hello! There is a problem that I can not solve on my own and decided to ask for help from the community. In the project I use this pattern:
<Style x:Key="EventsListStyle" TargetType="ListView" BasedOn="{StaticResource BaseEventsListStyle}"> <Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True" /> <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Standard" /> <Setter Property="ItemTemplateSelector" Value="{x:Static listItems:ListItemsDataTemplateSelector.Instance}" /> <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <VirtualizingStackPanel/> </ItemsPanelTemplate> </Setter.Value> </Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ScrollViewer> <ItemsPresenter /> </ScrollViewer> </ControlTemplate> </Setter.Value> </Setter> Everything works great. The control that uses this template is stretched in height and width to full screen. There is a need to implement a footer on the page with this control and that it is inside the scrollbar. Below I will try to show in the code what I need:
<Setter Property="Template"> <Setter.Value> <ControlTemplate> <ScrollViewer> <StackPanel Orientation="Vertical"> <ItemsPresenter /> <TextBlock Text="Footer"/> - тут вместо текстблока в проекте вью с контентом </StackPanel> </ScrollViewer> </ControlTemplate> </Setter.Value> But with this approach, virtualization is virtual. I forgot to say that ListBox contains a large number of records and it starts to terribly slow down if you turn it off. The content is rather heterogeneous, so I use Standard Mode. Maybe someone solved this problem? Thanks for answers.