Exemplo n.º 1
0
        public void AddRegistration(IViewRegistration registration)
        {
            if (registration == null)
            {
                throw new ArgumentNullException(nameof(registration));
            }

            _registrations.Add(registration.ViewModelType, registration);
        }
Exemplo n.º 2
0
        public void RemoveRegistration(IViewRegistration registration)
        {
            if (registration == null)
            {
                throw new ArgumentNullException(nameof(registration));
            }

            _registrations.Remove(registration.ViewModelType);
        }
Exemplo n.º 3
0
        private Window CreateView <TViewModel>(TViewModel viewModel)
        {
            IViewRegistration registration = GetRegistration(typeof(TViewModel));

            var window = registration.CreateView();

            window.DataContext = viewModel;
            window.Owner       = WindowUtil.GetActiveWindow();

            return(window);
        }