当VirtualisationMode = Recycling时,强制listview要求新的Container [英] Forcing listview to ask for new Container when VirtualisationMode = Recycling
问题描述
我得到了一个带有两个不同视图的数据绑定Listview,用户可以从中选择. 开关 I got a databound Listview with two different views, which the user can choose from. switch ( 此 .View.GetType().Name)
{ (this.View.GetType().Name)
{ 案例 ContainerTypeAView " case "ContainerTypeAView": case "ContainerTypeBView": 您好,沃尔夫冈, Hi Wolfgang, 这篇关于当VirtualisationMode = Recycling时,强制listview要求新的Container的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
VirtualisationMode正在回收.
当用户更改视图时,发生以下错误:
ItemsHost面板无法使用VirtualizationMode ==回收,因为IGeneratorHost.GetContainerForItemOverride方法返回具有不同类型的容器
在GetContainerForItemOverride中,我的代码是这样的:
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:
return new ContainerTypeA;
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
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