From 7227d3215afc55c629976c034e751ef06054d15e Mon Sep 17 00:00:00 2001 From: Holger Boerchers Date: Tue, 14 Aug 2018 23:29:51 +0200 Subject: [PATCH] Geschafft! --- MaterialModernWPF/App.xaml.cs | 14 ++++++++++---- .../Service/CalculationPackageContainer.cs | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) 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) {