• Wpf Prism.Unity 7


    Prism.Unity 中UnityBootStrapper已经不用了,可以继承PrismApplication

    1.Install-package Prism.Unity -v 7.2.0.1367

    2.

    <prism:PrismApplication x:Class="WpfApplication2.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:local="clr-namespace:WpfApplication2"
                 xmlns:prism="http://prismlibrary.com/">
        <prism:PrismApplication.Resources>
             
        </prism:PrismApplication.Resources>
    </prism:PrismApplication>

    3.

    using Prism.Unity;
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Threading.Tasks;
    using System.Windows;
    using Prism.Ioc;
    using CommonServiceLocator;
    using Prism.Modularity;
    
    namespace WpfApplication2
    {
        /// <summary>
        /// App.xaml 的交互逻辑
        /// </summary>
        public partial class App:PrismApplication
        {
            protected override void RegisterTypes(IContainerRegistry containerRegistry)
            {
               
            }
    
            protected override Window CreateShell()
            {
                return ServiceLocator.Current.GetInstance<MainWindow>();
            }
    
            protected override IModuleCatalog CreateModuleCatalog()
            {
                return base.CreateModuleCatalog();
            }
    
            protected override void InitializeModules()
            {
                base.InitializeModules();
            }
        }
    }
  • 相关阅读:
    camp训练day2
    LCA板子题
    牛客多校第一场
    P1063 能量项链 区间DP
    64. Minimum Path Sum
    46. Permutations
    216. Combination Sum III
    62. Unique Paths
    53. Maximum Subarray
    22. Generate Parentheses
  • 原文地址:https://www.cnblogs.com/Fred1987/p/11493226.html
Copyright © 2020-2023  润新知