Specify Action Settings button to specify settings

In this lesson, you will learn how to modify Action properties. The ClearTasks Action will be used. To see how the Action was implemented, refer to the Add a Simple Action lesson. In this lesson, you will add a tooltip, confirmation message and shortcut to it.

In this lesson, you will learn how to modify the Action property. We will use the cleanup task operation. To see how the operation is implemented, see Add a simple button curriculum. In this lesson, you will be prompted to add a tool, a confirmation message and shortcuts.

Note Note

Before proceeding, take a moment to review the following lessons.

Before proceeding, please take a moment to review the following courses.

  • Add a Simple Action
  • Place an Action in a Different Location
  • Since the ClearTasksAction is implemented in the common application module, you can specify its properties directly in this module. To do this, invoke the Model Editor by double-clicking the Model.DesignedDiffs.xafml file in the MySolution.Module project:
  • In the Model Editor, navigate to the ActionDesign | Actions node. Locate the ClearTasksAction node. To the right, the Action's settings are represented by properties. These properties are separated into collapsible categories.
  • Navigate to the Misc category. By default, the Tooltip property is set to Caption. Set it to "Clear the current Contact's tasks" instead. Set the Shortcut property to "Control+Shift+C", to specify a shortcut for the Action. Note that the specified shortcut will be displayed along with the Tooltip property value in the Action's tooltip. By default, the ConfirmationMessage property is set to the Action's ActionBase.ConfirmationMessage property value, which is specified in code. Replace this value with "Are you sure you want to clear the {0}'s Tasks list?". The "{0}" format item will be substituted with the object's default property value. A property can be specified as default via the DefaultProperty property of the BOModel | <Class> node in the Model Editor. Alternatively, the DefaultProperty attribute can be applied to the property's business class declaration.

  • Add a simple operation
  • The operation in other locations
  • Since ClearTasksAction is implemented in the common application program module, its properties can be specified directly in this module. To do this, double-click "model design Diffs.xafml." Project "Model Editor" to invoke Model Editor:
  • In the Model Editor, navigate to the operational design | operation node. Found "clear mission Operation" node. On the right side, represented by the attribute setting operation. These properties are foldably divided into categories.
  • Navigate to the miscellaneous category. By default, the "tool tip" attribute set to "headline." Instead, it is set to "remove the current contact mission." Shortcut attribute to "control _Shift_C", to specify the shortcut operation. Note that the shortcut will be designated "tool tip" is displayed along with a "tool tip" attribute value tooltip. By default, the "acknowledgment message" properties to the operating Base operation. Confirmation message attribute values, the attribute value specified in the code. This value is replaced with "Are you sure you want to remove {0} task list?" "{0}" format item will replace the default property values ​​for the object. It may be a default value of "Default Properties" attribute by attribute specifies BOModel | Model Editor <Class> node. Or, DefaultProperty attribute can be applied to business-class property declarations.
Note Note
Shortcuts are defined by simple strings that you need to type manually. The IModelAction.Shortcut property is used to parse the strings. Note that shortcuts will only work in a WinForms application.

Shortcuts by the need to manually type in a simple string definition. IModelAction. Shortcut property is used to parse the string. Note that the shortcut works only in WinForms applications.

 

At The Current Object identifier The by Will BE inserted The INTO at The Confirmation the Message IF at The Action's SelectionDependencyType Property IS not the SET to "work of the Independent." (So), ASSIGN at The "RequireSingleObject" value to at The SelectionDependencyType Property. This Property Belongs to at The Behavior category. By You CAN Also the SET the this to property "RequireMultipleObjects." the in the this Case, the COUNT of selected objects the will to bE Substituted confirmation message.
"choice depends on the type" If the property is not set operation is "independent", the current object identifier is inserted into the confirmation message . Thus, the "Need a single object" assigned to the selected value dependent on the type of property. This property belongs to the class behavior. You can also set this property to "require multiple objects." In this case, the count of the selected object is replaced by the acknowledgment message.

Tutorial_UIC_Lesson2_1

  • Run the WinForms or ASP.NET application and invoke the Detail View of any object, by double-clicking an existing one or creating a new one. Check to see if the Clear Tasks button has the required tooltip, can be executed via the specified shortcut, and a confirmation message with the specified text is invoked.
  • By double-clicking an existing object or create new objects, run WinForms or ASP.NET applications and call details view any object. Check the "clear mandate" button whether the tools you need tips, can be performed by specifying whether the shortcuts, and call confirmation message that contains the specified text.

WinForms Application

WinForms application

Tutorial_UIC_Lesson2_3

ASP.NET Application

ASP.NET applications

Tutorial_UIC_Lesson2_4

Note Note

You can also set an image for an Action. For details, refer to the Assign a Custom Image topic.

You can also set the image operation. For more information, see Assign custom image theme.

 

You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file, located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

Change the model editor you can model calls you made in this lesson. The main demonstration module project. The demo application is installed in the main % the PUBLIC% \ Documents \ DevExpress the Demos 19.2 \ Components \ eXpressApp Framework \ MainDemo by default. The Available Online at The ASP.NET Version IS AT http://demos.devexpress.com/XAF/MainDemo/

.

Guess you like

Origin www.cnblogs.com/foreachlife/p/Specify-Action-Settings.html