//step through pathing private void btnStep_Click(object sender, RoutedEventArgs e) { List <int> path = stepThrough.Step(unpop); if (path.Count > 0) { //this is a flag for letting the program know it reached the final node(and therefore it needs to draw a path with different colours) if (path.Last <int>() == 8080) { path.Remove(8080); DrawPath(path, Brushes.Blue); } else { DrawPath(path, Brushes.Gold); } } //refreshes the distances table with updated values after a step through dGridDist.Items.Refresh(); }