Z-Index of DrawingVisual on VisualHost
UPD: Solved. Look my comment
I have a VisualHost control with overriden
VisualChildrenCount
and GetVisualChild(int index)
.
Also it has a collection of Visuals
p开发者_开发知识库ublic List<Visual> Children { get; set; }
When i reorder items in the collection, their z-index for HitTest changes, but it displays still in wrong order.
Question: Should display order change or not ? If not then how can i change the display order of elements ?
On the image you can see that Rectangle is drawn nearly first, but oval and arc appear behind it.
Thanks.P.S. Of Course, after reordering i call InvalidateVisual()
Looks like the problem was in List<Visual>
. After converting to VisualCollection
and removing AddVisualChild()
and AddLogicalChild()
calls problem was solved.
精彩评论