zoukankan      html  css  js  c++  java
  • How to: Reorder an Action Container's Actions Collection 如何:重新排序按钮容器的按钮集合

    In an XAF application UI, Actions are located within Action Containers. You can use the ActionBase.Category property and the Application Model's ActionDesign | ActionToContainerMapping node to move the Action to another Action Container (see Place an Action in a Different Location). This topic describes how to reorder Actions within a specific container.

    在 XAF 应用程序 UI 中,操作位于操作容器中。您可以使用 ActionBase.Category 属性和应用程序模型的操作设计 |操作到容器映射节点以将操作移动到另一个操作容器(请参阅将操作放在其他位置)。本主题介绍如何对特定容器中的操作重新排序。

    Presume you have the MyAction Action implemented in the MyController Controller. The ActionBase.Category property is set to View for this Action. This means that the Action is displayed within the View Action Container. This Container may also contain other Actions - custom Actions, and actions from referenced modules. To reorder Actions of the View Action Container (or any other Action Container), invoke the Model Editor for the WinForms, ASP.NET or Mobile application project. Locate the ActionDesign | ActionToContainerMapping | View node. The following image shows that there are three Actions in the View Action Container.

    假定在"我的控制器"控制器中实施了"我的操作"操作。操作Base.类别属性设置为"查看此操作"。这意味着操作显示在视图操作容器中。此容器还可能包含其他操作 - 自定义操作和引用模块的操作。要重新排序视图操作容器(或任何其他操作容器)的操作,请调用 WinForms、ASP.NET或移动应用程序项目的模型编辑器。找到动作设计 |操作到容器映射 |查看节点。下图显示视图操作容器中有三个操作。

    PlaceActionToPosition_InitialSate

    To reorder these Actions, change the Index property for each Action. For instance, use the "0" value for MyAction, "1" - for Refresh, "2" - for ExecuteReport.

    要重新排序这些操作,更改每个操作的 Index 属性。例如,对 MyAction 使用"0"值,对"执行报告"使用"1" - 对于刷新,对执行报告使用"2"。"

    PlaceActionToPosition_Index

    If you run the application, you can ensure that the Actions order is changed as follows.

    如果运行该应用程序,则可以确保按如下方式更改操作顺序。

    PlaceActionToPosition_Runtime

    Note 注意
    • Actions from the Unspecified Action Container can be displayed by another container if you change the IFrameTemplate.DefaultContainer value for the current Template. These Actions are appended to the end of the collection. If you need to change their position within the Container, then first specify their Action Container explicitly.
    • In the application with the TabbedMDI UI type (see MdiShowViewStrategy), the main window's Actions collection is merged with the child window's Actions, which can influence the resulting Actions order.
    • 如果更改当前模板的 IFrameTemplate.Default容器值,则另一个容器可以显示来自"未指定操作容器"的操作。这些操作追加到集合的末尾。如果需要更改其在容器中的位置,请首先显式指定其操作容器。
    • 在具有 TabbedMDI UI 类型的应用程序中(请参阅 MdiShowView 策略),主窗口的"操作"集合将与子窗口的操作合并,这可能会影响生成的"操作"顺序。
     
    Tip 提示
    To change Action Containers order and location, customize the Template. In WinForms applications, you can also use the runtime customization capabilities.
    要更改操作容器的顺序和位置,请自定义模板。在 WinForms 应用程序中,您还可以使用运行时自定义功能。
  • 相关阅读:
    MySQL-02 数据表管理
    MySQL-01 MySQL数据库安装指南
    Linux-04 Linux中Tomcat和MySQL的安装
    Linux-03 Linux下的tar命令
    Linux-02 Linux常用命令
    Linux-01 虚拟机Linux的安装
    从服务器下载图片
    WPF Radio组的绑定
    使用缓存的9大误区(下)转载
    使用缓存的9大误区(上)转载
  • 原文地址:https://www.cnblogs.com/foreachlife/p/How-to-Reorder-an-Action-Container-s-Actions-Collection.html
Copyright © 2011-2022 走看看