private void window_Closed(object sender, EventArgs e) { Window window = sender as Window; IRegion region = _regionWeakReference.Target as IRegion; UserControlBase userbase = window.Content as UserControlBase; if (userbase != null) { userbase.Close(); } if (window != null && region != null) { if (region.Views.Contains(window.Content)) { region.Remove(window.Content); } } }