BlueSky.Windows.ValueLablesDialog.valLblRemoveBut_Click C# (CSharp) Method

valLblRemoveBut_Click() private method

private valLblRemoveBut_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void valLblRemoveBut_Click(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to delete a factor? Empty factors will be converted to NAs", "Warning! Delete Factor?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
            {
                ///No. Dont convert empty factors to NA. Allow me to modify
                OKclicked = false; //for allowing NAs, uncomment these 2 lines and comment 2 lines after if block
                return;
            }
            if (ValLstBox.SelectedIndex >= 0)
            {
                vlmatrix.delLevel(ValLstBox.SelectedItem.ToString(), 0);//shud come first. Before removing from the ValLstBox
                ValLstBox.Items.Remove(ValLstBox.SelectedItem);
                
                modified = true; 
            }
        }