WPF ListBox ScrollView不刷新
在我们的 WPF 应用程序中,我们有一个包含一些项目的列表框。我们暂时需要隐藏一些项目,但由于我们需要保持项目顺序,因此我们不会删除它们。我们只是将可见性设置为折叠。
到目前为止,这工作正常,但 ListView 的 ScrollViewer 不会刷新。它仍然和以前一样长,并且当您尝试滚动时会显示一些非常奇怪的行为。
当项目折叠时有什么方法可以刷新 ScrollViewer 吗?或者还有其他的方式来存档我们所做的事情吗?从 ListView 中删除项目不是一个选项。
in our WPF application we have and Listbox with a few items. We temporary need to hide some of the items but since we need to keep the item order we don't remove them. We just set the visibility to collapsed.
This works fine so far but the ScrollViewer of the ListView does not refresh. It is still as long as before and shows some very strange behavior when you try to scroll.
Is there any way to refresh the ScrollViewer when items are collapsed? Or any other was to archive what we have done? Removing the items from the ListView is not an option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您设置了 ItemContainerStyle 吗?一样:
Have you set the ItemContainerStyle? Just like: