private void NewGadget_Click(object sender, RoutedEventArgs e) { addGadget addWindow = new addGadget(); addWindow.Show(); addWindow.Closed += delegate(object s, EventArgs a) { RefreshGadgets(); }; }