private void valLblChangeBut_Click(object sender, RoutedEventArgs e)
{
if (ValLstBox.SelectedIndex >= 0)
{
int index = ValLstBox.SelectedIndex;
///////add////////
//string newv = ValuetextBox.Text;
string newl = labelTextbox.Text;
//validations here. 1.No duplicates, 2.v could be numeric only
//Checking duplicate value and lable
if (isDuplicate(newl))
{
MessageBox.Show("Duplicate entry!");
}
else
{
vlmatrix.changeLevel(ValLstBox.Items.GetItemAt(index).ToString(), newl);//shud com first, before changing valLstBox itms.
/////remove////////
ValLstBox.Items.RemoveAt(index);
//Adding to list if value is unique
ValLstBox.Items.Insert(index, newl);
//ValuetextBox.Text = "";
labelTextbox.Text = "";
modified = true;
}
}
}