ui-virtualization

WPF 4.0 pixel-based scrolling in VirtualizingStackPanel

自古美人都是妖i 提交于 2020-02-01 08:20:25
问题 I have the following XAML snippet: <ItemsControl ItemsSource="..." ItemTemplate="..." VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard" ScrollViewer.CanContentScroll="True"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Vertical" utils:VirtualizingStackPanelAttachedProperties.IsPixelBasedScrollingEnabled="True"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.Template> <ControlTemplate>

WPF 4.0 pixel-based scrolling in VirtualizingStackPanel

社会主义新天地 提交于 2020-02-01 08:19:07
问题 I have the following XAML snippet: <ItemsControl ItemsSource="..." ItemTemplate="..." VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard" ScrollViewer.CanContentScroll="True"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Vertical" utils:VirtualizingStackPanelAttachedProperties.IsPixelBasedScrollingEnabled="True"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.Template> <ControlTemplate>

How to reliably detect when an item is scrolled outside of view?

倖福魔咒の 提交于 2019-12-23 01:12:11
问题 I have a large collection of items bound to a ListBox , with a VirtualizingStackPanel set as its ItemsPanel . As the user scrolls and item containers are created, I do some work to populate the item with data (using a database query). If the user scrolls very rapidly, it builds up a large number of requests that tend to bog things down. What I would like to do is detect when the item is scrolled outside of the viewport, so I can cancel its corresponding request. Here are the approaches I've

Improve performance for huge ListBox in StackPanel?

本小妞迷上赌 提交于 2019-12-03 07:43:52
I am using a StackPanel to layout several controls vertically (ie, Title, sub titles, listbox, separator, listbox, etc). The StackPanel is a child of a ScrollViewer to ensure its content is always scrollable. One of the controls in the StackPanel is a ListBox. Its ItemsSource is data bound to a huge collection, and a complex DataTemplate is used to realise each item. Unfortunately, I'm getting really poor performance (high cpu/memory) with it. I tried setting the ListBox's ItemsPanel to a VirtualizingStackPanel, and overriding its ControlTemplate to only an ItemsPresenter (remove the ListBox's

How to use UI virtualization with redefined ListBox templates

谁都会走 提交于 2019-12-02 11:58:44
问题 I'm trying to use ListBox as a view containing multiple items and, of course, I need to use UI virtualization in it. The problem is virtualization works only when I declare ListBox this way: <ListBox ItemsSource="{Binding ItemsSource}" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"> <ListBox.ItemTemplate> <DataTemplate> <views:SiteEntryView /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> But if I try to customize it, it doesn't

WPF Virtualized TreeView with different orientations within doesn't virtualize?

懵懂的女人 提交于 2019-12-02 01:32:03
问题 I have a TreeView in XAML with multiple layers. Using this solution I can get a XAML-configured look for each of the different layers, and confirmed that it is UI virtualizing. However, when I switch a particular layer's VirtualizingStackPanel to have a different Orientation (it doesn't matter whether through code like this solution, or with Snoop) than its parent, then UI virtualization switches off and the TreeView realizes all the TreeViewItem s as soon as I expand that layer. While

WPF Virtualized TreeView with different orientations within doesn't virtualize?

天大地大妈咪最大 提交于 2019-12-01 20:37:32
I have a TreeView in XAML with multiple layers. Using this solution I can get a XAML-configured look for each of the different layers, and confirmed that it is UI virtualizing. However, when I switch a particular layer's VirtualizingStackPanel to have a different Orientation (it doesn't matter whether through code like this solution , or with Snoop ) than its parent, then UI virtualization switches off and the TreeView realizes all the TreeViewItem s as soon as I expand that layer. While researching this behavior I noticed that within the reference source for VirtualizingStackPanel as you

Is there a (good/free) VirtualizingWrapPanel available for WPF? [closed]

天大地大妈咪最大 提交于 2019-11-28 23:00:14
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I've found a couple of alternatives, this CodePlex project and this commercial one, but the former is extremely inefficient in my

Resources and guides to UI virtualization in WPF [closed]

ぃ、小莉子 提交于 2019-11-27 11:59:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . UI Virtualization is an awkward terminology that describes WPF UI controls that load and and dispose child elements on demand (based on their visibility) to reduce memory footprint. ListBox and ListView use a class called VirtualizingStackPanel by default to achieve higher performance. I found this control,

why setting ScrollViewer.CanContentScroll to false disable virtualization

孤街浪徒 提交于 2019-11-26 19:00:54
As most WPF developers know, setting ScrollViewer.CanContentScroll to false will disable virtualization; but I'd like to know how it works, because I try to enable virtualization while setting ScrollViewer.CanContentScroll to false . rudigrobler "ScrollViewer currently allows two scrolling modes: smooth pixel-by-pixel scrolling (CanContentScroll = false) or discrete item-by-item scrolling (CanContentScroll = true). Currently WPF supports UI virtualization only when scrolling by item. Pixel-based scrolling is also called “physical scrolling” and item-based scrolling is also called “logical