I wanted to refactor this big piece of bloated code ,I feel like there is a better way to rewrite this. Does anyone have idea of how to do it?
if (ls.SelectedIndex == 1) { grid1.Visibility = Visibility.Visible; }
...
if (ls.SelectedIndex == 58) { grid58.Visibility = Visibility.Visible; }