当前位置: 首页 > news >正文

网站空间在哪买好活动推广方案怎么写

网站空间在哪买好,活动推广方案怎么写,网址转换成二维码,山东青岛网站设计--概述这个项目演示了如何在WPF中使用各种Prism功能的示例。如果您刚刚开始使用Prism#xff0c;建议您从第一个示例开始#xff0c;按顺序从列表中开始。每个示例都基于前一个示例的概念。此项目平台框架#xff1a;.NET Core 3.1Prism版本#xff1a;8.0.0.1909提示… --概述这个项目演示了如何在WPF中使用各种Prism功能的示例。如果您刚刚开始使用Prism建议您从第一个示例开始按顺序从列表中开始。每个示例都基于前一个示例的概念。此项目平台框架.NET Core 3.1Prism版本8.0.0.1909提示这些项目都在同一解决方法下需要依次打开运行可以选中项目-》右键-》设置启动项目然后运行目录介绍Topic描述Bootstrapper and the Shell创建一个基本的引导程序和shellRegions创建一个区域Custom Region Adapter为StackPanel创建自定义区域适配器View Discovery使用视图发现自动注入视图View Injection使用视图注入手动添加和删除视图View Activation/Deactivation手动激活和停用视图Modules with App.config使用应用加载模块。配置文件Modules with Code使用代码加载模块Modules with Directory从目录加载模块Modules loaded manually使用IModuleManager手动加载模块ViewModelLocator使用ViewModelLocatorViewModelLocator - Change Convention更改ViewModelLocator命名约定ViewModelLocator - Custom Registrations为特定视图手动注册ViewModelsDelegateCommand使用DelegateCommand和DelegateCommandTCompositeCommands了解如何使用CompositeCommands作为单个命令调用多个命令IActiveAware Commands使您的命令IActiveAware仅调用激活的命令Event Aggregator使用IEventAggregatorEvent Aggregator - Filter Events订阅事件时筛选事件RegionContext使用RegionContext将数据传递到嵌套区域Region Navigation请参见如何实现基本区域导航Navigation Callback导航完成后获取通知Navigation Participation通过INavigationAware了解视图和视图模型导航参与Navigate to existing Views导航期间控制视图实例Passing Parameters将参数从视图/视图模型传递到另一个视图/视图模型Confirm/cancel Navigation使用IConfirmNavigationReqest界面确认或取消导航Controlling View lifetime使用IRegionMemberLifetime自动从内存中删除视图Navigation Journal了解如何使用导航日志部分项目演示和介绍① BootstrapperShell启动界面这个主要演示Prism框架搭建的用法step1在nuget上引用Prsim.Unitystep2修改App.xaml设置引导程序Application x:ClassBootstrapperShell.Appxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:localclr-namespace:BootstrapperShellApplication.Resources/Application.Resources /Applicationpublic partial class App : Application{protected override void OnStartup(StartupEventArgs e){base.OnStartup(e);var bootstrapper new Bootstrapper();bootstrapper.Run();}}step3在引导程序中设置启动项目using Unity; using Prism.Unity; using BootstrapperShell.Views; using System.Windows; using Prism.Ioc;namespace BootstrapperShell {class Bootstrapper : PrismBootstrapper{protected override DependencyObject CreateShell(){return Container.ResolveMainWindow();}protected override void RegisterTypes(IContainerRegistry containerRegistry){}} }step4在MainWindow.xaml中显示个字符串Window x:ClassBootstrapperShell.Views.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlTitleShell Height350 Width525GridContentControl ContentHello from Prism //Grid /Window②ViewInjection视图注册MainWindow.xaml通过ContentControl 关联视图Window x:ClassViewInjection.Views.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:prismhttp://prismlibrary.com/TitleShell Height350 Width525DockPanel LastChildFillTrueButton DockPanel.DockTop ClickButton_ClickAdd View/ButtonContentControl prism:RegionManager.RegionNameContentRegion //DockPanel /WindowMainWindow.xaml.cs鼠标点击后通过IRegion 接口注册视图public partial class MainWindow : Window{IContainerExtension _container;IRegionManager _regionManager;public MainWindow(IContainerExtension container, IRegionManager regionManager){InitializeComponent();_container container;_regionManager regionManager;}private void Button_Click(object sender, RoutedEventArgs e){var view _container.ResolveViewA();IRegion region _regionManager.Regions[ContentRegion];region.Add(view);}}③ActivationDeactivation视图激活和注销MainWindow.xaml.cs这里在窗体构造函数中注入了一个容器扩展接口和一个regin管理器接口分别用来装载视图和注册regin窗体的激活和去激活分别通过regions的Activate和Deactivate方法实现public partial class MainWindow : Window{IContainerExtension _container;IRegionManager _regionManager;IRegion _region;ViewA _viewA;ViewB _viewB;public MainWindow(IContainerExtension container, IRegionManager regionManager){InitializeComponent();_container container;_regionManager regionManager;this.Loaded MainWindow_Loaded;}private void MainWindow_Loaded(object sender, RoutedEventArgs e){_viewA _container.ResolveViewA();_viewB _container.ResolveViewB();_region _regionManager.Regions[ContentRegion];_region.Add(_viewA);_region.Add(_viewB);}private void Button_Click(object sender, RoutedEventArgs e){//activate view a_region.Activate(_viewA);}private void Button_Click_1(object sender, RoutedEventArgs e){//deactivate view a_region.Deactivate(_viewA);}private void Button_Click_2(object sender, RoutedEventArgs e){//activate view b_region.Activate(_viewB);}private void Button_Click_3(object sender, RoutedEventArgs e){//deactivate view b_region.Deactivate(_viewB);}}④UsingEventAggregator事件发布订阅事件类定义public class MessageSentEvent : PubSubEventstring{}注册两个组件ModuleA和ModuleBprotected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog){moduleCatalog.AddModuleModuleA.ModuleAModule();moduleCatalog.AddModuleModuleB.ModuleBModule();}ModuleAModule 中注册视图MessageViewpublic class ModuleAModule : IModule{public void OnInitialized(IContainerProvider containerProvider){var regionManager containerProvider.ResolveIRegionManager();regionManager.RegisterViewWithRegion(LeftRegion, typeof(MessageView));}public void RegisterTypes(IContainerRegistry containerRegistry){}}MessageView.xaml视图中给button俺妞妞绑定命令UserControl x:ClassModuleA.Views.MessageViewxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:prismhttp://prismlibrary.com/ prism:ViewModelLocator.AutoWireViewModelTrue Padding25StackPanelTextBox Text{Binding Message} Margin5/Button Command{Binding SendMessageCommand} ContentSend Message Margin5//StackPanel /UserControlMessageViewModel.cs在vm中把界面绑定的命令委托给SendMessage然后在方法SendMessage中发布消息using Prism.Commands; using Prism.Events; using Prism.Mvvm; using UsingEventAggregator.Core;namespace ModuleA.ViewModels {public class MessageViewModel : BindableBase{IEventAggregator _ea;private string _message Message to Send;public string Message{get { return _message; }set { SetProperty(ref _message, value); }}public DelegateCommand SendMessageCommand { get; private set; }public MessageViewModel(IEventAggregator ea){_ea ea;SendMessageCommand new DelegateCommand(SendMessage);}private void SendMessage(){_ea.GetEventMessageSentEvent().Publish(Message);}} }在MessageListViewModel 中接收并显示接收到的消息public class MessageListViewModel : BindableBase{IEventAggregator _ea;private ObservableCollectionstring _messages;public ObservableCollectionstring Messages{get { return _messages; }set { SetProperty(ref _messages, value); }}public MessageListViewModel(IEventAggregator ea){_ea ea;Messages new ObservableCollectionstring();_ea.GetEventMessageSentEvent().Subscribe(MessageReceived);}private void MessageReceived(string message){Messages.Add(message);}}以上就是这个开源项目比较经典的几个入门实例其它就不展开讲解了有兴趣的可以下载源码自己阅读学习。源码下载github访问速度较慢所以我下载了一份放到的百度网盘百度网盘链接https://pan.baidu.com/s/10Gyks2w-R4B_3z9Jj5mRcA 提取码0000---------------------------------------------------------------------开源项目链接https://github.com/PrismLibrary/Prism-Samples-Wpf技术群添加小编微信并备注进群小编微信mm1552923   公众号dotNet编程大全
http://www.huolong8.cn/news/101661/

相关文章:

  • 网站建设的功能有哪些内容wordpress主题与演示不一样
  • asp网站和php网站的区别景德镇网站维护
  • 南京企业网站seo孝昌县专注网站建设代理
  • 网站规划与建设ppt建设网站都需要什么
  • 成都企业如何建网站wordpress内外网访问
  • 企业导航网站源码高端网站设计公司
  • 国企网站建设有没有做链接的网站
  • 手机网站智能建站深圳电商平台网站建设
  • 如何查询网站的空间大小网站做支付宝接口吗
  • 自己做音乐网站挣钱吗互联网运营
  • 教育网站建设方案模板中英双语外贸网站源码
  • 旅游网站建设策划书模板大型的网站后台用什么做
  • 手机网站开发服务商如何做校园网站
  • nas搭建网站最新百度新闻
  • 校园二手书交易网站开发网站条形码如何做
  • 站长工具查询wordpress 调用豆瓣
  • 农业大学网站建设特点江苏省建设招标网站
  • 成都百度网站设计公司免费写作文网站
  • 成都网站建设空间拓者设计吧室内设计官网免费账号
  • 岳溥庥网站建设网站交互做的比较好的
  • seo 网站优化世界500强企业关于优秀员工的12条核心标准
  • 可不可以自己做网站做一个网站做少多少钱
  • 企业网站开发 文献综述网站建设成本计划
  • 支付的网站建设费整么做账上传wordpress后网页为什么空白
  • php .net做网站哪个好厦门网站建设小程序开发
  • 企业做网站的费用如果做账wordpress 前台插件
  • 别人 网站 粘贴 html 推广微信营销的方法和技巧
  • asp网站免费完整源码手机qq空间登录网页入口
  • 山西省建设监理协会官方网站济南便宜企业网站建设费用
  • 网站开发团队公司模式wordpress wordpress