-
-
Notifications
You must be signed in to change notification settings - Fork 42
ModelViewInheritance
The ModuleViewInheritance
changes the default Model View generation without coding.
This is a platform agnostic
module that extends the model views nodes with the IModelObjectViewMergedDifferences
interface to allow model view differences composition.
We want to change the default Model View generation without coding, using the XAF ModelEditor
Traditionally:
Doing such a complex task without building a similar functionality is not possible. You need an engine that will generate model layers out of user predefined rules. You need to have tests and EasyTest for it. In this case that eye cannot do it.
Xpand.XAF.Modules Solution:
The cross platform Xpand.XAF.Modules.ModuleViewInheritance module reprograms
the default design-time
model view generation
to respect existing view model differences.
In the next screencast:
- First we extend the model with the GridView component using the Xpand.XAF.Modules.ModelMapper.
- Then, we used the CloneView package to clone the
BaseObject_ListView
as aCommonGridView_ListView
. - Next, the Xpand.XAF.Modules.Reactive
WhenGeneratingModelNodes
is used to assign theCommonGridView_ListView
as abase
view. - Finally, we
modify
the CopyToClipBoard value on theCommonGridView_ListView
andcheck
that is reflected appropriately on theCustomer_ListView
.
v1.1.39
#471. Adds the DeepMerge
attribute which if enable the module will recourse and merge the source view differences.
Possible future improvements:
- Any other need you may have.
Let me know if you want me to implement them for you.
Bellow are a few examples of how we use the module in eXpandFramework
.
to derive a version with Remember Me
support as below:
The next WorldCreator
modified version of PersistentMemberInfo
:
is used to derive a version for the PersistentCoreTypeMemberInfo
like:
and in addition one for the PersistentCollectionMemberInfo
-
First you need the nuget package so issue this command to the
VS Nuget package console
Install-Package Xpand.XAF.Modules.ModelViewInheritance
.The above only references the dependencies and nexts steps are mandatory.
-
Ways to Register a Module or simply add the next call to your module constructor
RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.ModelViewInheritanceModule));
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.
.NetFramework: net461
DevExpress.ExpressApp | Any |
Fasterflect.Xpand | 2.0.7 |
JetBrains.Annotations | 2020.1.0 |
System.ValueTuple | 4.5.0 |
Xpand.Extensions | 2.202.44 |
Xpand.Extensions.XAF | 2.202.45 |
Xpand.VersionConverter | 2.202.9 |
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.ModelViewInheritance.ModelViewInheritanceModule))
The module is tested on Azure for each build with these tests. All Tests run as per our Compatibility Matrix