private void ParamRowDuplicate(/*bool newNameAndID*/) { var selectedParamRow = ParamEntryList.SelectedItem as ParamRow; var selectedParam = MainTabs.SelectedItem as PARAMRef; if (selectedParam == null || selectedParamRow == null) { return; } var newParamRow = new ParamRow(); if (false /*newNameAndID*/) { //var nameEntry = new QuickTextEntry(); //nameEntry.Title = "New Param"; //nameEntry.TextBlockPrompt.Text = "Please input the desired" } else { newParamRow.ID = selectedParamRow.ID; newParamRow.Name = selectedParamRow.Name; } newParamRow.SaveDefaultValuesToRawData(selectedParam.Value); newParamRow.LoadValuesFromRawData(selectedParam.Value); foreach (var cell in newParamRow.Cells) { cell.Value = selectedParamRow[cell.Def.Name]; } selectedParam.Value.Entries.Insert(selectedParam.Value.Entries.IndexOf(selectedParamRow), newParamRow); }
private void ParamEntryList_AddingNewItem(object sender, AddingNewItemEventArgs e) { var row = new ParamRow(); row.Name = "New Entry"; row.ReInitRawData(SelectedParam); row.LoadValuesFromRawData(SelectedParam); row.SaveDefaultValuesToRawData(SelectedParam); e.NewItem = row; }