public int GetX(StepInfo step, int position)
{
StepInfo parent = step.Parent;
if (IsRoot(parent))
{
int stepIndex = parent.Children.IndexOf(step);
for (int i = 0; i < stepIndex; i++)
{
position += countSteps(parent.Children.ElementAt(i))+1;
}
}
else
{
position += parent.Children.IndexOf(step) + 1;
position = GetX(parent, position);
}
return position;
}