1 Star 0 Fork 66

hllxml/OpenCVSharpHelper

forked from 易极/OpenCVSharpHelper 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
opencvsharpModule.cs 2.41 KB
一键复制 编辑 原始数据 按行查看 历史
易极 提交于 2022-06-05 14:06 +08:00 . 反射需要导航的页面
using ModuleCore.Common;
using ModuleCore.Mvvm;
using OpencvsharpModule.Models;
using OpencvsharpModule.Views;
using Prism.Ioc;
using Prism.Modularity;
using System.Linq;
using System.Reflection;
namespace OpencvsharpModule
{
public class ModuleOpenCVSharp : IModule
{
public void OnInitialized(IContainerProvider containerProvider)
{
var Navigate = containerProvider.Resolve<NavigateModel>();
var views = from t in Assembly.GetExecutingAssembly().GetTypes() //
where t.GetCustomAttribute<NavigationPageAttribute>() is not null
select t;
foreach (var view in views)
{
var page = view.GetCustomAttribute<NavigationPageAttribute>();
Navigate.NavigateList.Add(new NavigateItem()
{
ViewName = page.ViewName,
IconKind = page.IconKind,
DisplayName = page.DisplayName,
UserLevel = page.UserLevel,
Display = page.Display
});
}
Navigate.DefaultView = "CameraView";
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterSingleton<CalibrateCommon>();
containerRegistry.RegisterSingleton<CameraModel>();
containerRegistry.RegisterSingleton<ImagePool>();
containerRegistry.RegisterSingleton<DataPool>();
containerRegistry.RegisterSingleton<RoslynEditorModel>();
containerRegistry.RegisterDialog<CalibrateView, ViewModels.CalibrateViewModel>();
containerRegistry.RegisterForNavigation<CameraView>();
containerRegistry.RegisterForNavigation<ThresholdView>();
containerRegistry.RegisterForNavigation<MorphologyView>();
containerRegistry.RegisterForNavigation<HoughLinesView>();
containerRegistry.RegisterForNavigation<RoslynView>();
containerRegistry.RegisterForNavigation<FeatureMatchingView>();
containerRegistry.RegisterForNavigation<ConnectedView>();
containerRegistry.RegisterForNavigation<MaskCopyView>();
containerRegistry.RegisterForNavigation<CannyView>();
containerRegistry.RegisterForNavigation<HogSvmView>();
containerRegistry.RegisterForNavigation<CornersView>();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/hllxml/opencvsharphelper.git
git@gitee.com:hllxml/opencvsharphelper.git
hllxml
opencvsharphelper
OpenCVSharpHelper
master

搜索帮助