public static int CompareFunc(UIWidget left, UIWidget right) { if (left.mDepth > right.mDepth) return 1; if (left.mDepth < right.mDepth) return -1; return 0; }