private void removelvlbutton_Click(object sender, RoutedEventArgs e)
{
string selectedlevel = levelsListBox.SelectedItem.ToString();
if (FactorLevels.Contains(selectedlevel))
{
FactorLevels.Remove(selectedlevel);
levelsListBox.ItemsSource = null;
levelsListBox.ItemsSource = FactorLevels;
}
else
{
MessageBox.Show("Cannot Remove Level! ", "Remove Level", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}