I have about 50 different pieces of data that I need to call, for minimum and maximum values. I'm sure there's a better way than doing the following:
public void refreshminmaxvalues(List<minmaxvalues> listminmaxvalues)
{
txtMinA_1.Text = minmaxvalueslist[0].minvalue.ToString();
txtMaxA_1.Text = minmaxvalueslist[0].maxvalue.ToString();
txtMinB_1.Text = minmaxvalueslist[0].minvalueB.ToString();
txtMaxB_1.Text = minmaxvalueslist[0].maxvalueB.ToString();
txtMin_2.Text = minmaxvalueslist[1].minvalue.ToString();
txtMax_2.Text = minmaxvalueslist[1].maxvalue.ToString();
}
The above code takes values from a list for min and max. The MinA and MinB are two values that are linked together, and thus will be called differently from the rest. Everything past txtMax_2 will just have one min and one max value.
Does anyone know a better, more "efficient" way of doing this code, rather than just writing out all 50+ values?
If it helps, these are the values that are edited in XAML:
<!-- Minimum -->
<TextBox Name="txtMinA_1" Text=""/>
<TextBox Name="txtMinB_1" Text=""/>
<TextBox Name="txtMin_2" Text=""/>
<TextBox Name="txtMin_3" Text=""/>
<TextBox Name="txtMin_4" Text=""/>
<!-- Maximum -->
<TextBox Name="txtMaxA_1" Text=""/>
<TextBox Name="txtMaxB_1" Text=""/>
<TextBox Name="txtMax_2" Text=""/>
<TextBox Name="txtMax_3" Text=""/>
<TextBox Name="txtMaxH_4" Text=""/>