开发者

Inheriting System.Windows.Controls.Panel

开发者 https://www.devze.com 2022-12-30 07:45 出处:网络
I use the Panel to provide custom layout of UIElements. For this, I override MeasureOverride and ArrangeOverride. In ArrangeOverride proper locations are given to Children.

I use the Panel to provide custom layout of UIElements.

For this, I override MeasureOverride and ArrangeOverride. In ArrangeOverride proper locations are given to Children.

In my application, there is a bunch of rather heavy (by number of visuals) children inside th开发者_运维问答e panel, but only 2 of them are located inside the visible region at a time.

Working with my application I feel like all the visuals are drown.

I need to introduce a kind of 'virtualization' and make the children render (or take CPU cycles) selectively.

How do I?


Have a look at this topic: WPF VirtualizingStackPanel for increased performance


If your panel is placed inside a ScrollViewer, you can implement IScrollInfo.
Can be quite a bit of code though, but there a couple of blogs out there with examples, for example here and here

I found that this blog post describes more closely what you're trying to accomplish, though not exactly.

0

精彩评论

暂无评论...
验证码 换一张
取 消