diff --git a/MaterialModernWPF/App.xaml.cs b/MaterialModernWPF/App.xaml.cs index 154b60d..eb4a543 100644 --- a/MaterialModernWPF/App.xaml.cs +++ b/MaterialModernWPF/App.xaml.cs @@ -1,9 +1,8 @@ -using System.Collections.Generic; -using System.Windows; +using System.Windows; +using DryIoc; using MaterialModernWPF.Module; using MaterialModernWPF.Service; using MaterialModernWPF.View; -using Prism.DryIoc; using Prism.Ioc; using Prism.Modularity; @@ -12,8 +11,15 @@ namespace MaterialModernWPF /// /// Interaktionslogik für "App.xaml" /// - public partial class App : PrismApplication + public partial class App { + protected override Rules CreateContainerRules() + { + return Rules.Default.WithAutoConcreteTypeResolution() + .With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments)) + .WithDefaultIfAlreadyRegistered(IfAlreadyRegistered.AppendNotKeyed); + } + protected override void RegisterTypes(IContainerRegistry containerRegistry) { containerRegistry.Register(); diff --git a/MaterialModernWPF/Service/CalculationPackageContainer.cs b/MaterialModernWPF/Service/CalculationPackageContainer.cs index c3e55b5..71b871d 100644 --- a/MaterialModernWPF/Service/CalculationPackageContainer.cs +++ b/MaterialModernWPF/Service/CalculationPackageContainer.cs @@ -23,7 +23,7 @@ namespace MaterialModernWPF.Service private void SelectionChanged((CalculationPackage sender, bool isSelected) payload) { - var viewKey = payload.sender.CalculationViewType.FullName; + var viewKey = payload.sender.GetType().FullName; var region = _regionManager.Regions[Constants.PackagesRegion]; if (payload.isSelected) {