private void Goto(GridItem item) { if (item.PathIndex == null) { item.PathIndex = Squares.Max(x => x.PathIndex ?? 0) + 1; Route.Add(item); } }