Skip to content

ListBox 无法虚拟化 #1452

@cuiliang

Description

@cuiliang

Describe the bug

由于在模板中对ScrollViewer设置了CanContentScroll="false",造成了ListBox 无法虚拟化,当列表条目数量较多时会非常卡顿。

<hc:ScrollViewer IsInertiaEnabled="{Binding Path=(hc:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">

还有不少地方设置了这个属性,不清楚是否也存在类似的影响:
https://github.com/search?q=repo%3AHandyOrg%2FHandyControl%20CanContentScroll%3D%22false%22&type=code

Steps to reproduce the bug

~

Expected behavior

No response

Screenshots

No response

NuGet package version

HandyControl 3.4.0

IDE

Visual Studio 2022

Framework type

.Net Framework 4.7.2

Windows version

Windows 11 (22000)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions