当VirtualisationMode = Recycling时,强制listview要求新的Container [英] Forcing listview to ask for new Container when VirtualisationMode = Recycling

查看:57
本文介绍了当VirtualisationMode = Recycling时,强制listview要求新的Container的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个带有两个不同视图的数据绑定Listview,用户可以从中选择.
VirtualisationMode正在回收.
当用户更改视图时,发生以下错误:

ItemsHost面板无法使用VirtualizationMode ==回收,因为IGeneratorHost.GetContainerForItemOverride方法返回具有不同类型的容器

在GetContainerForItemOverride中,我的代码是这样的:


开关

I got a databound Listview with two different views, which the user can choose from.
The VirtualisationMode is recycling.
When the user changes the view, the folowing error occur:

ItemsHost panel cannot use VirtualizationMode == Recycling because the IGeneratorHost.GetContainerForItemOverride method returns containers that have different types

In GetContainerForItemOverride i have code like this:


switch

( .View.GetType().Name)

{

(this.View.GetType().Name)

{

 

案例 ContainerTypeAView " 案例 ContainerTypeBView "

case "ContainerTypeAView":
return new ContainerTypeA;

case "ContainerTypeBView":
return new ContainerTypeB;
}

Seems like a little bug here. When changing the view, the systen tries to reuse the container from the old type.

Is there a way, to force the system to ask for new Containers ?

Regards
Wolfgang

推荐答案

您好,沃尔夫冈,

您使用的Visual Studio是什么版本?我看不到ListView类具有VirtualisationMode属性.

您能在一个简单的项目中重现该问题并将其发送给我吗?我的电子邮件地址是microsoft dot com上的v-lliu.

谢谢,
Linda Liu

Hi Wolfgang,

What's the version of Visual Studio you're using? I don't see the ListView class has a VirtualisationMode property.

Could you please reproduce the problem in a simple project and send it to me? My email address is v-lliu at microsoft dot com.

Thanks,
Linda Liu


这篇关于当VirtualisationMode = Recycling时,强制listview要求新的Container的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆