Skip to content
apobekiaris edited this page Aug 13, 2020 · 79 revisions

GitHub issues GitHub close issues

About

The CloneModelView package generated additional default design time model views.

Details

This is a platform agnostic module. Using the CloneModelViewAttribute in your Bussiness Objects you can:

  1. Create one or many DetailViews or ListViews or LookupListViews.
  2. Additionally for the cloned view you can configure if it will be the default view for the Business Object.
  3. If you cloned a ListView it is possible the configure related DetailView
Next snippet is taken from the ModelDifference module.
 [RuleCombinationOfPropertiesIsUnique("MDO_Unique_Name_Application", DefaultContexts.Save, nameof(Name)+"," +nameof(PersistentApplication)+","+nameof(DeviceCategory))]
    [CreatableItem(false), NavigationItem("Default"), HideFromNewMenu]
    [ModelDefault("Caption", Caption), ModelDefault("IsClonable", "True"), VisibleInReports(false)]
    [CloneView(CloneViewType.DetailView, "MDO_DetailView",true)]
    [CloneView(CloneViewType.ListView, "MDO_ListView_Tablet",true)]
    [CloneView(CloneViewType.ListView, "MDO_ListView_Desktop",true)]
    [CloneView(CloneViewType.ListView, "MDO_ListView_Mobile",true)]
    [CloneView(CloneViewType.ListView, "MDO_ListView_All",true)]
    [CloneView(CloneViewType.ListView, "MDO_ListView", true)]
    [Appearance("Disable DeviceCategory for win models", AppearanceItemType.ViewItem,
        "EndsWith([" + nameof(PersistentApplication) + "." + nameof(BaseObjects.PersistentApplication.ExecutableName) +"], '.exe')", 
        Enabled = false, TargetItems = nameof(DeviceCategory))]
    [RuleCombinationOfPropertiesIsUnique(nameof(PersistentApplication)+","+nameof(DifferenceType)+","+nameof(CombineOrder))]
    public class ModelDifferenceObject : XpandCustomObject, IXpoModelDifference {

Possible future improvements:

  1. Any other need you may have.

Let me know if you want me to implement them for you.

Installation

  1. First you need the nuget package so issue this command to the VS Nuget package console

    Install-Package Xpand.XAF.Modules.CloneModelView.

    The above only references the dependencies and nexts steps are mandatory.

  2. Ways to Register a Module or simply add the next call to your module constructor

    RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.CloneModelViewModule));

Versioning

The module is not bound to DevExpress versioning, which means you can use the latest version with your old DevExpress projects Read more.

The module follows the Nuget Version Basics.

Dependencies

.NetFramework: net461

DevExpress.ExpressApp Any
Fasterflect.Xpand 2.0.7
JetBrains.Annotations 2020.1.0
System.ValueTuple 4.5.0
Xpand.Extensions.XAF 2.202.42
Xpand.Patcher 2.0.23
Xpand.VersionConverter 2.202.9

Issues-Debugging-Troubleshooting

To Step in the source code you need to enable Source Server support in your Visual Studio/Tools/Options/Debugging/Enable Source Server Support. See also How to boost your DevExpress Debugging Experience.

If the package is installed in a way that you do not have access to uninstall it, then you can unload it with the next call at the constructor of your module.

Xpand.XAF.Modules.Reactive.ReactiveModuleBase.Unload(typeof(Xpand.XAF.Modules.CloneModelView.CloneModelViewModule))

Tests

The module is tested on Azure for each build with these tests. All Tests run as per our Compatibility Matrix

image

image


Custom badge

Star the project if you think it deserves it.

GitHub stars

Fork the project to extend and contribute.

GitHub forks

Clone this wiki locally