I thought I'd find everything I need on sorting online, but this one eludes me. I have a single instance of a class. The class has two arrays. I have to sort the combined two elements of the class based on one of the two arrays. It's easy to sort a single array - but how do I sort the combination of the two? I thought it would involve IComparable, but that seems to be for multiple instances of the class, not just one.
The class (I want to sort on data, descending):
public class RGraphData
{
public int[] data { get; set; }
public string[] labels { get; set; }
}
Note that the number of items in both data and labels are identical.