首页 > 其他分享 >学习012-02-05 Dialog Controller(对话框控制器)

学习012-02-05 Dialog Controller(对话框控制器)

时间:2024-12-29 14:56:16浏览次数:3  
标签:02 控制器 05 对话框 up Controller Dialog DialogController TargetWindow

Dialog Controller(对话框控制器)

The XAF has several Controllers that are automatically added to each Frame and provide basic functionality in applications (NewObjectViewController, ShowNavigationItemController, etc.). However, this does not include the DialogController- you need to add it manually if it is required. It is used to add the Accept and Cancel buttons in pop-up Windows. For instance, the Dialog Controller is contained in the pop-up Window that is invoked by a PopupWindowShowAction. This Controller provides the OK and Cancel buttons. This topic describes the Dialog Controller’s behavior and how to use it in a pop-up Window.
XAF有几个控制器,它们会自动添加到每个框架中,并在应用程序(NewObjectViewController、ShowNavigationItemController等)中提供基本功能。但是,这不包括对话框控制器——如果需要,您需要手动添加它。它用于在弹出窗口中添加接受和取消按钮。例如,对话框控制器包含在由PopupWindowShowAction调用的弹出窗口中。此控制器提供确定和取消按钮。本主题描述对话框控制器的行为以及如何在弹出窗口中使用它。

Dialog Controller Overview(对话框控制器概述)

The DialogController is inherited from the WindowController class. It contains the following Actions:
DialogController继承自WindowController类。它包含以下操作:
在这里插入图片描述

The Dialog Controller has the following specificities:
对话控制器具有以下特性:

  • If a pop-up Window with the Dialog Controller displays a List View, the ListViewProcessCurrentObjectController.ProcessCurrentObjectAction (executed when you click or double-click a row) closes the pop-up window and accepts the dialog. This behavior is designed for Lookup List Views. To cancel closing the pop-up Window and process the ProcessCurrentObjectAction as in regular windows, set the DialogController.CloseOnCurrentObjectProcessing property to false.
    如果带有对话框控制器的弹出窗口显示列表视图,ListViewProcessCurrentObjectController。ProcessCurrentObjectAction(单击或双击一行时执行)关闭弹出窗口并接受对话框。此行为是为查找列表视图设计的。要取消关闭弹出窗口并像在常规窗口中一样处理ProcessCurrentObjectAction,请将对话框控制器。CloseOnCurrentObjectProcessing属性设置为false。
  • In addition to Dialog Controller members related to Actions, there is a DialogController.WindowTemplateChanged event. Handle it if you need to customize the Template assigned to a pop-up Window.
    除了与Actions相关的Dialog Controller成员之外,还有一个DialogController.WindowTemplateChanged事件。如果您需要自定义分配给弹出窗口的模板,请处理它。
  • You can customize the DialogController class by inheriting from it.
    您可以通过继承来自定义DialogController类。
  • Dialog Controllers are not added to a Frame’s Frame.Controllers collection automatically. You need to add them manually when required.
    对话框控制器不会自动添加到框架的框架.控制器集合中。您需要在需要时手动添加它们。

Dialog Controllers in Pop-up Windows Invoked via ShowViewParameters Objects(通过ShowViewParameter对象调用弹出窗口中的对话控制器)

To invoke a Window after an Action is executed, specify an ActionBaseEventArgs.ShowViewParameters parameter of the Action’s Execute event handler. The following conditions should be satisfied to create the invoked Window pop-up application:
要在Action执行后调用Window,请指定Action的Execute事件处理程序的ActionBaseEventArgs. ShowViewParameter参数。创建调用的Window弹出应用程序应满足以下条件:

  • The ShowViewParameters.TargetWindow property is set to TargetWindow.NewModalWindow, and the ShowViewParameters.Context property is set to TemplateContext.PopupWindow.
    ShowViewParameters. TargetWindow属性设置为TargetWindow.NewModalWindow,ShowViewParameters.Context属性设置为TemplateContext.PopupWindow。
  • The TargetWindow property is set to TargetWindow.NewModalWindow, the Context property is set to TemplateContext.Undefined (default value), and the ShowViewParameters.Controllers collection is not empty.
    TargetWindow属性设置为TargetWindow. NewModalWindow,Context属性设置为TemplateContext.Undefined(默认值),并且ShowViewParameter.Controller集合不为空。
  • The TargetWindow property is set to TargetWindow.NewWindow, and the Context property is set to PopupWindow.
    TargetWindow属性设置为TargetWindow. NewWindow,Context属性设置为PopupWindow。
  • In SDI mode, the TargetWindow property is set to TargetWindow.NewWindow, the Context property is set to TemplateContext.Undefined (default value), and the ShowViewParameters.Controllers collection is not empty.
    在SDI模式下,TargetWindow属性设置为TargetWindow. NewWindow,Context属性设置为TemplateContext.Undefined(默认值),并且ShowViewParameter.Controller集合不为空。

To add a Dialog Controller to the pop-up window, use the ShowViewParameters.Controllers parameter of the Action’s Execute event handler. The following code demonstrates how to create a List View in a pop-up window and add a Dialog Controller:
要将Dialog Controller添加到弹出窗口,请使用Action的Execute事件处理程序的ShowViewParameter. Controller参数。以下代码演示了如何在弹出窗口中创建列表视图并添加Dialog Controller:

C#
using DevExpress.ExpressApp.SystemModule;
// ...
void myAction_Execute(Object sender, SimpleActionExecuteEventArgs e) {
   IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(MyBusinessClass));
   string listViewId = Application.FindListViewId(typeof(MyBusinessClass));
   e.ShowViewParameters.CreatedView = Application.CreateListView(
      listViewId,
      Application.CreateCollectionSource(objectSpace, typeof(MyBusinessClass), listViewId),
      true);
   e.ShowViewParameters.TargetWindow = TargetWindow.NewWindow;
   e.ShowViewParameters.Context = TemplateContext.PopupWindow;
   e.ShowViewParameters.Controllers.Add(Application.CreateController<DialogController>());
}

Note

  • You can add the built-in DialogController or a custom one that is inherited from it.
    您可以添加内置的DialogController或从它继承的自定义DialogController。
  • If the ShowViewParameters.CreateAllControllers property is set to false and you want the Actions’ buttons in a Template, add the FillActionContainersController to the Controllers collection.
    如果ShowViewParameter.CreateAllControllers属性设置为false,并且您希望模板中的Actions按钮,请将FillActionContainersController添加到Controller集合中。

Dialog Controllers in Pop-up Windows Invoked via PopupWindowShowAction Type Actions(通过PopupWindowShowAction类型操作调用弹出窗口中的对话框控制器)

The pop-up Windows which are invoked when pressing a Pop-up Window Show Action contain a DialogController type Dialog Controller. You can change the behavior of the Dialog Controller’s Actions as follows:
按下弹出窗口显示操作时调用的弹出窗口包含DialogController类型的Dialog Controller。您可以更改Dialog Controller的操作的行为,如下所示:

在这里插入图片描述

You can use the PopupWindowShowAction.CustomizePopupWindowParams event handler’s CustomizePopupWindowParamsEventArgs.DialogController parameter to customize the default Dialog Controller the pop-up Window uses. You can also replace this Dialog Controller with a custom one. The code below demonstrates creating a List View in a Pop-up Window and adding a custom Dialog Controller.
您可以使用PopupWindowShowAction.CustomizePopupWindowParams事件处理程序的CustomizePopupWindowParamsEventArgs. DialogController参数来自定义弹出窗口使用的默认对话框控制器。您也可以将此对话框控制器替换为自定义控制器。下面的代码演示了在弹出窗口中创建列表视图和添加自定义对话框控制器。

C#
private void MyPopupWindowShowAction_CustomizePopupWindowParams(object sender, 
      CustomizePopupWindowParamsEventArgs e) {
   IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(MyBusinessClass));
   string listViewId = Application.FindListViewId(typeof(MyBusinessClass));
   e.View =  Application.CreateListView(
      listViewId,
      Application.CreateCollectionSource(objectSpace, typeof(MyBusinessClass), listViewId),
      true);
   e.DialogController = Application.CreateController<MyDialogController>();
}

标签:02,控制器,05,对话框,up,Controller,Dialog,DialogController,TargetWindow
From: https://blog.csdn.net/thomastang200912_126/article/details/144803750

相关文章

  • 2024-11-25《Vscode热部署》
    VsCode配置Javaweb热部署(Deploy)   最近又开始使用VsCode来进行web开发,但是每次都需要package一下项目再放到Tomcat下面太繁琐了,就想着能不能像IDEA一样可以进行热部署,经过不懈百度后终于发现了解决方法。首先需要以下三个插件:  首先我们要去创建一个webapp项目,具体的......
  • 学习012-02-04 Customize Controllers and Actions(自定义控制器和操作)
    CustomizeControllersandActions(自定义控制器和操作)ToimplementanewfeatureintheXAF,createanewController.Ifthefeaturerequiresend-userinteraction,addActionstoit.Atthesametime,youmayneedtocustomizeaControllerorActionprovi......
  • 2024-11-28《关于mybatis创建的mapper映射路径不对导致的系列报错》
    关于mybatis创建的mapper映射路径不对导致的系列报错 今天在写mybatis项目的时候,使用注解发现无法使用别名,添加ResultMap的时候直接报错显示无法解析。经过百度了好久也是成功的发现了问题的所在,就是这个:这个路径创建的时候我以为创建的是分级目录,实际上创建成为了com.inn......
  • 2024-11-27《架构漫谈读后感》
    架构漫谈读后感 首先,最近在课上老师推荐我们阅读王概凯老师的架构漫谈连载博客,通过详细的阅读,我确实收获颇丰。首先就是对于架构是什么,架构解决的是什么有了一个深入的了解。第一,什么架构呢?王概凯老师认为他没有一个确切的定义,在软件行业,每个人都有自己的理解,所以一百个人心......
  • 2024-11-29《axios获取不到response返回的响应的解决方法》
    axios获取不到response返回的响应的解决方法 今天在用mybatis+vue+axios写登录界面的时候,发现用户名还有密码的数据都能够传输到servlet里,但是当servlet对html界面进行相应的时候,axios却收不到消息,经过长时间的排查后也没有发现问题,终于在今晚的百度下发现了结果,上原文:解决方......
  • 2024-12-3《利用ffmpeg推流到rtsp,再利用jmpeg在html界面上显示的解决办法》
    利用ffmpeg推流到rtsp,再利用jmpeg在html界面上显示的解决办法  目录需求在python代码里推流到rtsphtml里播放rtsp视频流 需求最近在百度飞桨上训练了一个摔倒识别的模型,用的PaddleDetection这个模型,训练好以后我部署到了Windows,但是我看大多数人都是部署到了......
  • 2024-12-4《大数据指令汇总》
    大数据指令汇总  目录使用Finalshell作为连接机器界面命令汇总针对全部会话的命令Zookeeper集群启动:Zookeeper集群状态:Zookeeper集群关闭:针对当前会话的命令Hadoop启动:Hadoop关闭:hive1启动:hive2启动:beeline启动:beeline登录(账户是root,密码为空):hbase......
  • 2024-12-05《关于pip总是下载到基础环境不下载到虚拟环境》
    关于pip总是下载到基础环境不下载到虚拟环境 今天使用pip安装包报错了,使用piplist查询了一下发现竟然默认安装在了基础环境里,我激活了conda的虚拟环境再运行pip依然是安装在了基础环境里,百度后发现解决方法为去除掉系统环境变量里的PYTHONHOME然后使用虚拟环境变量里的虚拟......
  • 2024-12-06《WebApplication配置》
    WebApplication是用于配置HTTP管道和路由的web应用程序,接来下我将一一拆解它的组成。//////ThewebapplicationusedtoconfiguretheHTTPpipeline,androutes.///[DebuggerDisplay("{DebuggerToString(),nq}")][DebuggerTypeProxy(typeof(WebApplication.WebApplicatio......
  • 2024-11-15《继续c#学习-多态性》
    多态性静态多态性函数重载  函数重载就是一个函数可以通过传入不同的参数来进行不同的运算,例如: usingSystem; namespacePolymorphismApplication { publicclassTestData { publicintAdd(inta,intb,intc) { returna+......