I need to bring to front a custom control in WPF.
pseudoCode
OnMouseDown()
{
if (this.parent != null)
this.parent.BringToFront(this);
}
I know, I know that there are a ZIndex, but still don't understand how to replace the simple WinForm BringToFront
to parent.SetZIndex(this, ?MaxZIndex(parent)? + 1)
?
Perhaps there is a better way of doing it in the such a cool thing like WPF?!..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…