开发者

What is the Disadvantage of VirtualizingStackPanel?

What is/are the main disadvantage of Virtualizin开发者_开发百科gStackPanel? If it doesn't have any, then why it is not made as a default panel behavior/template in ItemsControl?


The MSDN page on the VirtualizingStackPanel Class has the following statements:

The word "virtualize" refers to a technique by which a subset of user interface (UI) elements are generated from a larger number of data items based on which items are visible on-screen.

and

Virtualization in a StackPanel only occurs when the items control contained in the panel creates its own item containers.

and

VirtualizingStackPanel is the default items host for the ListBox element.

From this it looks like for the "normal" use of a StackPanel as a host for buttons, text blocks etc. virtualisation wouldn't offer any advantages or might even impose a performance overhead. When used in a ListBox virtualisation does have benefits as a) item containers are created by the items control and b) there are likely to be more elements in the list than can be shown on the screen at any one time.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜