private void BtnAddNew_Click(object sender, RoutedEventArgs e) { if (dw2 == null) { dw2 = new DW2(vm) { Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner }; dw2.Closed += DW2_Closed; dw2.Show(); } }
private void DW2_Closed(object sender, System.EventArgs e) => dw2 = null;