计算机(网站建设与维护),黄石公司网站建设,网站开发服务 税,免费网站的app文章目录 设置首页启动页增加配置接口添加接口文件#xff1a;实现接口 配置启动选项 设置首页启动页
增加配置接口
添加接口文件#xff1a;
Mytodo.Common/IConfigureInterface.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.T… 文章目录 设置首页启动页增加配置接口添加接口文件实现接口 配置启动选项 设置首页启动页
增加配置接口
添加接口文件
Mytodo.Common/IConfigureInterface.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace Mytodo.Common
{public interface IConfigureInterface{void Configure();}
}实现接口
MainViewmodel.cs
删除 CreatMenuBar();原位置的代码 public void Configure(){CreatMenuBar();//导航到主页regionManager.Regions[PrismManager.MainViewRegionName].RequestNavigate(IndexView);}配置启动选项
App.xmal.cs 重写OnInitialized方法 protected override void OnInitialized(){var service App.Current.MainWindow.DataContext as IConfigureInterface;if (service ! null){service.Configure();}base.OnInitialized();}