private void btnWidthSearch_Click(object sender, RoutedEventArgs e) { if (MazePath.th_num > 0) { --MazePath.th_num; initMazeGrid(); mp = new MazePath(md, ref gMaze); mp.findMazeWay(); btnClearPath.IsEnabled = true; } }