AABBbaby

导航

UI组件DevExpress WinForm入门指南 - 当前对话服务

DevExpress Services将命令从ViewModel传递到View中的控件,这允许您在不分离应用程序层的情况下修改 UI。

获取工具下载 - DevExpress v21.2

当前对话服务

允许您管理当前可见的对话框。

接口

DevExpress.Mvvm.ICurrentDialogService

注册

仅当存在激活对话框时才存在服务 - 您无法注册 CurrentDialogService。

Create() Methods

None.

公共服务方法

  • Close()Close(MessageResult dialogResult) 和 Close (UICommand dialogResult) - 用给定的 DialogResult 关闭一个对话框。 如果结果是 UICommand 类型,则调用相关的 UICommand。 请注意,您只能使用最初在 ShowDialog 方法中传递给对话服务的 UICommand当中的一个。
  • WindowState - 此属性允许您更改对话框的窗口状态(正常、最小化或最大化)。
CurrentWindowService

类似于 CurrentDialogService,但允许您管理当前的应用程序窗口(窗体)。

接口

DevExpress.Mvvm.ICurrentWindowService

全局注册

无法使用。

本地注册

C#

 

mvvmContext1.RegisterService(CurrentWindowService.Create(this));
mvvmContext1.RegisterService(CurrentWindowService.Create(listBoxControl1));

 

VB.NET

 

mvvmContext1.RegisterService(CurrentWindowService.Create(Me))
mvvmContext1.RegisterService(CurrentWindowService.Create(listBoxControl1))

 

Create() Methods

  • Create(Control container) - 允许您为托管分配为方法参数控件的任何表单注册服务。
  • Create(Form currentForm) - 为此表单注册服务。
  • Create(Func<Form> getCurrentForm) - 为 getCurrentForm 方法返回的任何表单注册一个服务。

公共服务 API

  • Activate()Close()Hide() 和 Show() - 允许您控制当前窗口的可见性。
  • WindowState - 此属性允许您更改窗体的窗口状态(正常、最小化或最大化)。

DevExpress WinForm | 下载试用

DevExpress WinForm拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!


DevExpress技术交流群5:742234706      欢迎一起进群讨论

更多DevExpress线上公开课、中文教程资讯请上中文网获取

posted on 2022-02-17 11:10  AABBbaby  阅读(126)  评论(0)    收藏  举报