private void EditWindow_Closed(object sender, EventArgs e) { EditWindow ew = (EditWindow)sender; ListBoxItem lbi = (ListBoxItem)ew.lbi; Baowen bw = (Baowen)lbi.Content; Baowen updateBaowen = this.ss.getBaowen(bw.Id); updateBaowen.Bw = updateBaowen.Bw.Replace(" ", ""); lbi.Content = updateBaowen; }
private void ListBoxItem_MouseDoubleClick(object sender, RoutedEventArgs e) { ListBoxItem lbi = (ListBoxItem)sender; EditWindow ew = new EditWindow(lbi); Baowen bw = (Baowen)lbi.Content; ew.Title = "修改报文: " + bw.Id; ew.Closed += new EventHandler(EditWindow_Closed); ew.Show(); }