Tworzysz klasę która ma te 6 elementów (w sensie tablice z 6 elementami), do tej klasy indekser i możesz się odwoływać do tych elementów. Jeśli to nie rozwiązuje problemu to pokaż bardziej szczegółowy kod.
ObservableCollection<ChampionsChosen> chosen = new ObservableCollection<ChampionsChosen>();
var a = chosen.First(d => d.Name == cham);
var picked = itemClass.First(d => d.Name == item);
string[] tab = new string[6];
tab[0] = Item1;
tab[1] = Item2;
tab[2] = Item3;
tab[3] = Item4;
tab[4] = Item5;
tab[5] = Item6;
for (int i = 0; i < 6; i++)
{
if (picked.Name == itemchampions[i, 0])
{
if (picked.Status == false)
{
a.Item1 = picked.Name;
//a.tab[1] = picked.Name;
countClass.First(d => d.Name == picked.Name).Count = countClass.First(d => d.Name == picked.Name).Count + 1;
}
else
{
a.Item1 = "";
//a.tab[1] = "";
countClass.First(d => d.Name == picked.Name).Count = countClass.First(d => d.Name == picked.Name).Count - 1;
}
}
}
class ChampionsChosen
{
public string Photo { get; set; }
public string Name { get; set; }
public string Traits1 { get; set; }
public string Traits2 { get; set; }
public string Traits3 { get; set; }
public string Item1 { get; set; }
public string Item2 { get; set; }
public string Item3 { get; set; }
public string Item4 { get; set; }
public string Item5 { get; set; }
public string Item6 { get; set; }
}
Moim problemem jest to, że nie wiem jakiego typu danych musiała by być tablica, żeby umieścić w niej te elementy listy. ta tablica wyrzuca błąd. I chciałbym się odwoływać po przez to co jest okomentowane //a.tab[1] = picked.Name; zamiast a.Item1 = picked.Name;