Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight 4嵌套列表框控制性能问题_Silverlight_Performance_Listbox_Nested - Fatal编程技术网

Silverlight 4嵌套列表框控制性能问题

Silverlight 4嵌套列表框控制性能问题,silverlight,performance,listbox,nested,Silverlight,Performance,Listbox,Nested,我正在制作一个silverlight页面,该页面将有一个水平列表框,其中将包含一个“卡片”列表。每个“卡片”都包含一个垂直列表框,其中包含一些文本。但是,我遇到了很多性能问题。过去是否有人遇到过嵌套列表框的性能问题?如果是DataGrid,则分页可以提供良好的性能。如果它是ListBox,那么我们应该关注与ListBox绑定的数据的数量 您正在尝试从服务器绑定单次快照上的完整列表吗?那么这肯定会影响性能。如果是DataGrid,那么分页可以提供良好的性能。如果它是ListBox,那么我们应该关注

我正在制作一个silverlight页面,该页面将有一个水平列表框,其中将包含一个“卡片”列表。每个“卡片”都包含一个垂直列表框,其中包含一些文本。但是,我遇到了很多性能问题。过去是否有人遇到过嵌套列表框的性能问题?

如果是DataGrid,则分页可以提供良好的性能。如果它是ListBox,那么我们应该关注与ListBox绑定的数据的数量


您正在尝试从服务器绑定单次快照上的完整列表吗?那么这肯定会影响性能。

如果是DataGrid,那么分页可以提供良好的性能。如果它是ListBox,那么我们应该关注与ListBox绑定的数据的数量


您正在尝试从服务器绑定单次快照上的完整列表吗?那么这肯定会影响性能。

UI虚拟化可能会帮助您。尝试使用VirtualzingStackPanel(而不是StackPanel)作为列表框的ItemsPanel:

<ListBox>
    ...
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

...

UI虚拟化可能会对您有所帮助。尝试使用VirtualzingStackPanel(而不是StackPanel)作为列表框的ItemsPanel:

<ListBox>
    ...
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

...

了解一下体积会有所帮助,水平列表框中有多少项?一次可以看到多少个?每个垂直列表框中有多少项?您是否指定了自己的“项目”面板?了解一下体积会有所帮助,水平列表框中有多少项目?一次可以看到多少个?每个垂直列表框中有多少项?您正在指定自己的项目面板吗?我正在绑定到构造函数中生成的列表。卡片列表只有20个项目,每个列表框项目中的垂直子列表只有25个纯文本列表框项目。但是,性能非常糟糕。我绑定到构造函数中生成的列表。卡片列表只有20个项目,每个列表框项目中的垂直子列表只有25个纯文本列表框项目。然而,表演很糟糕。