【Prism】Region 关联页面

这篇博客详细介绍了如何在Prism框架中使用Region,包括下载Prism库、设置Bootstrapper、在Xaml中定义Region、注册Region以及最终的效果展示。作者通过实例展示了如何在ShellView.xaml中划分Region,并在Bootstrapper中配置ModuleCatalog,将Region与对应的View关联起来。
摘要由CSDN通过智能技术生成

MSDN教程,看完后温习一遍,就算是中文懒人包吧。这是个利用ArcGIS Earth API 写的一个 Tool。


一、下载Prism

如图所示,在NuGet包中下载对应的Prism
这里写图片描述

二、设置Bootstrapper

Prism框架中,从Bootstraaper启动程序,新建Bootstrapper

using Prism.Unity;
using Prism.Modularity;
using Prism.Regions;
using StressTestToolPrism.Views;

namespace StressTestToolPrism
{
    class Bootstrapper : UnityBootstrapper
    {

        protected override DependencyObject CreateShell()
        {
            return new ShellView();
        }

        protected override void InitializeShell()
        {
            base.InitializeShell();
            Application.Current.MainWindow = (Window)this.Shell;
            Application.Current.MainWindow.Show();
        }       
    }
}

打开App.cs , 重写OnStartup方法

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.L
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值