private void SetValuetxt_KeyUp(object sender, KeyEventArgs e) { List <BaseConvertTO> collection = ModelItem.Properties["ConvertCollection"].ComputedValue as List <BaseConvertTO>; if (collection != null) { int result = -1; BaseConvertTO lastItem = collection.LastOrDefault(c => c.FromExpression != string.Empty); if (lastItem != null) { result = collection.IndexOf(lastItem) + 2; if (result > -1) { while (collection.Count > result) { Resultsdg.RemoveRow(collection.Count - 1); } } } } Resultsdg.AddRow(); ModelItem.Properties["DisplayName"].SetValue(createDisplayName()); }
void DeleteRowMenuItemClick(object sender, RoutedEventArgs e) { Resultsdg.RemoveRow(Resultsdg.SelectedIndex); var modelProperty = ModelItem.Properties["DisplayName"]; if (modelProperty != null) { modelProperty.SetValue(CreateDisplayName()); } }
void DeleteRow_MenuItem_Click(object sender, RoutedEventArgs e) { Resultsdg.RemoveRow(Resultsdg.SelectedIndex); ModelItem.Properties["DisplayName"].SetValue(createDisplayName()); }