public void AddRegistration(IViewRegistration registration) { if (registration == null) { throw new ArgumentNullException(nameof(registration)); } _registrations.Add(registration.ViewModelType, registration); }
public void RemoveRegistration(IViewRegistration registration) { if (registration == null) { throw new ArgumentNullException(nameof(registration)); } _registrations.Remove(registration.ViewModelType); }
private Window CreateView <TViewModel>(TViewModel viewModel) { IViewRegistration registration = GetRegistration(typeof(TViewModel)); var window = registration.CreateView(); window.DataContext = viewModel; window.Owner = WindowUtil.GetActiveWindow(); return(window); }