private void Button_ClickAddManifestHead(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(TextBox_ManifestHeadName.Text)) { KeyValue kv = new KeyValue(); kv.key = TextBox_ManifestHeadName.Text; ManifestHeadList.Add(kv); ManifestHeadList = ManifestHeadList; TextBox_ManifestHeadName.Text = ""; } }
private void Button_ClickDeleteManifestHead(object sender, RoutedEventArgs e) { Button btn = sender as Button; string key = (string)btn.Tag; for (int i = 0; i < ManifestHeadList.Count; i++) { if (ManifestHeadList[i].key == key) { ManifestHeadList.RemoveAt(i); } } ManifestHeadList = ManifestHeadList; }