Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Collapse]Extra Modules
   [Expand]Audit Trail Module Overview
    Business Class Library Customization Module
    Chart Module
    Clone Object Module
   [Expand]Conditional Appearance Module Overview
   [Expand]Dashboards Module
    File Attachments Module Overview
    HTML Property Editor Module
    Localization Module Overview
   [Expand]Notifications Module
    KPI Module
   [Expand]Maps Module
   [Expand]Pivot Chart Module
    Pivot Grid Module
   [Expand]Reports V2 Module
   [Expand]Reports Module (Obsolete)
   [Expand]Scheduler Module
    Script Recorder Module
   [Expand]State Machine Module
   [Expand]TreeList Editors Module
   [Expand]Validation Module
    View Variants Module
   [Expand]Workflow Module
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Clone Object Module

The Clone Object module allows end-users to quickly create similar objects by cloning them, and changing the required properties. For this purpose, this module provides a View Controller that contains the CloneObject Action. When executing this Action, the required object is cloned. This topic details this Action's default behavior and provides information on available customizations.

Important

Currently, we do not to provide built-in support for Entity Framework (EF) in this module, because its implementation heavily depends on our XPO ORM, and we do not have a sufficient number of customer requests in this regard. If you use EF for data access in your XAF application and require a similar functionality for your project, feel free to contact us and describe your business requirements so we can provide you with alternative solutions. In general, you can integrate any custom or standard solution for Entity Framework, which you would implement to solve the same requirement in non-XAF applications. We will also continue monitoring user demand in this regard and it is possible that we will review our current decision in the future.

Expanded Clone Object Module Overview

The Clone Object module consists of a single assembly: DevExpress.ExpressApp.CloneObject.v17.2. So, you can add the CloneObjectModule to the common application module to use its CloneObject Action in WinForms and ASP.NET applications. For this purpose, invoke the Module Designer and drag the CloneObject module from the Toolbox to the RequiredModules panel. If you need to add this module to an application project, invoke the Application Designer and drag the CloneObject module from the Toolbox's XAF Modules page to the Modules panel on the Designer. Rebuild your solution after adding the module.

Tip

The Clone Object module supplies the CloneObjectViewController View Controller. This Controller contains the CloneObject Single Choice Action, targeted for cloning the currently selected object. In addition, the CloneObject module extends the Application Model's BOModel | <Class> nodes with the IModelClassCloneable.IsCloneable property. Set it to true, to enable cloning of class objects.

The CloneObject Action is activated for Views representing an object type whose BOModel | <Class> node's IsCloneable property is set to true. This Action enables you to create a clone of the current object as an object of the current type. In addition, you can create an object of a class inherited from the current object's base class. For this purpose, set the base class' IsCloneable property to true. By default, the CloneObject Action is disabled when there are unsaved changes in the current object, because the clone process works in a separate Object Space. The following image demonstrates the CloneObject Action activated for the Contact class. The Action's dropdown list contains the Contact type, because the IsCloneable property is set to true for the Person class - the base class for the Contact.

To specify that a particular field or property cannot be cloned, apply the NonCloneableAttribute to it.

Note

The CloneObject Action's Items collection does not include object types that are prohibited for the current user by the Security System.

Expanded Clone Object Module Customization

To edit the settings of the CloneObjectViewController or the CloneObject Action, use the Application Model's ActionDesign | Actions | CloneObject or ActionDesign | Controllers | DevExpress.ExpressApp.CloneObject.CloneObjectViewController nodes. These nodes are available in the Model Editor when the CloneObject module is added.

To change the behavior of the CloneObjectViewController or CloneObjectAction, create a custom View Controller, and access the Controller and its Action in the Controller.Activated event handler. Refer to the CloneObjectViewController.CloneObjectAction topic, to see an example. Additionally, you can handle events exposed by the CloneObjectViewController class.

Expanded See Also

How would you rate this topic?​​​​​​​