设计师刷新3D [英] Designer Refresh 3D
问题描述
我在XAML中指定了Model3DGroup,带有灯光和一个Model3DGroup子元素。
基于依赖属性,我定义了"BoxCount"。我在程序上定义的各个位置动态地向Model3DGroup子项添加其他框。 在OnBoxCountChanged处理程序中,我从Model3DGroup中删除任何旧框,
然后生成并添加新框。
问题在于,当我在设计器中更改BoxCount时,它有时不会清除旧框(因此它会在旧框之上绘制新框)。  ;但是,如果我重建项目,它会清除旧框。 在运行时,
一切似乎都运行良好。
有没有办法在属性更改时强制刷新? viewport3D.InvalidateVisual();不起作用。
尝试 UpdateLayout(): http://msdn.microsoft.com/en-us/library/system.windows.uielement.updatelayout.aspx
I have a Model3DGroup specified in XAML With lights and one Model3DGroup child element.
Based on a dependency property I have defined "BoxCount" I dynamically add additional boxes to the Model3DGroup children at various positions I define procedurally. In the OnBoxCountChanged handler, I remove any old boxes from the Model3DGroup, and then generate and add the new boxes.
The problem is that when I change the BoxCount in the designer, it sometimes does not clear the old boxes (so it draws the new boxes on top of the old ones). However, if I do a rebuild of the project, it does clear the old boxes. At runtime, everything seems to work fine.
Is there a way to force a refresh when the property changes? viewport3D.InvalidateVisual(); does not work.
Try UpdateLayout(): http://msdn.microsoft.com/en-us/library/system.windows.uielement.updatelayout.aspx.
这篇关于设计师刷新3D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!