static Transform UnwrapDpiTransform(Transform currentTransform) { if (currentTransform != null && UIHooks.GetIsDpiTransform(currentTransform)) { var group = currentTransform as TransformGroup; if (group != null && group.Children.Count > 1) { return(group.Children[0]); } return(null); } return(currentTransform); }