有大量孩子的 StackPanel [英] StackPanel with huge amount of children
问题描述
我正在基于代码项目中的 Outlook 日历示例构建一个 wpf 控件,
i'm building a wpf control based on the outlook calender sample in code project,
首先我想知道这是一个很好的示例还是这不是编写控件的方式?
first of all i wanna know if this is a good sample or that this is not the way of writing controls?
第二,我需要支持日历的毫秒视图,意思是超过 24 * 60 * 60 件
second, i need to support milliseconds view of the calender, the meaning of that is more than 24 * 60 * 60 items
我的问题是如何构建这个面板(如果它仍然应该是一个 StackPanel
)以及如何在分辨率(缩放)更改时重新填充面板并避免在执行填充时卡住 gui.
my question is how to build this panel(if it should still be a StackPanel
)
and how can i refill the panel when resolution (zoom) changes and avoid stucking the gui while i perform the fill.
总结:我需要一种快速的方法将许多项目插入到 wpf 中的 StackPanel
.
to sum up : i need a fast way to insert many items to a StackPanel
in wpf.
推荐答案
也许你可以使用 VirtualizingStackPanel
类.请记住,您需要对面板的项目进行数据绑定以使其虚拟.
Perhaps you can use the VirtualizingStackPanel
class. Remember you need to databind the items of the panel to make it virtual.
这篇关于有大量孩子的 StackPanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!