private void mEdit_Click(object sender, RoutedEventArgs e) { GongsiName gongsi = (GongsiName)this.listGongsi.SelectedItem; SetValueWindow setting = new SetValueWindow { Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner }; setting.SetValue(gongsi.Name); setting.ShowDialog(); if (Selected == gongsi.Name) { Selected = setting.gcname; } gongsi.Name = setting.gcname; }