Closed krombipils closed 9 months ago
does not work in runtime as well?
For me it also does not work in runtime. I attached a small sample project. In this project I create ModelMergedDifference nodes with View = BaseObject_ListView.
moduleManager.WhenGeneratingModelNodes<IModelMergedDifferences>()
.Do(differences =>
{
var diff = differences.AddNode<IModelMergedDifference>("MergedDiffFromSetup");
diff.View = (IModelListView)differences.Application.Views.GetNode("BaseObject_ListView");
}).Subscribe(this);
ModelChanges of the BaseObject_ListView, e.g. ShowGroupPanel are not merged, e.g. to the PersistentClass1_ListView. For the PersistentClass2_ListView I added another ModelMergedDifference node with the ModelEditor. Now the changes are merged to PersistentClass2_ListView.
I think the ModelViewInheritance module has another problem, when using the new simplified XAF solution structure: By default there is no win specific module anymore and changes are directly stored in the Model.xafml of the win executable project. The Model.xafml has a 'Content' build action, but the CreateUnchangeableLayer implementation searches for embedded resources diffs. Am I right?
I think the ModelViewInheritance module has another problem, when using the new simplified XAF solution structure: By default there is no win specific module anymore and changes are directly stored in the Model.xafml of the win executable project. The Model.xafml has a 'Content' build action, but the CreateUnchangeableLayer implementation searches for embedded resources diffs. Am I right?
most probably the package was not desinged with the front end model in mind. It will take some time to examine the case be aware. Do I understand correctly that the problem is also there when u using embedded models?
By default there is no win specific module anymore and changes are directly stored in the Model.xafml of the win executable project. The Model.xafml
i think we already have an auto merge all embeded models functionality, did u tried to add a new embeded model to your project?
Never used your MDO concept. So what do you suggest? Add a MDO embedded resource to the win project and check if ModelViewInheritance works?
if it works for a module with embedded models the MDO is no differnent
and the Win project if it has a ModuleBase descenant also behaves like a hybrid module-frontend
if it does not have just add one and register it with your app
You mean adding an embedded model in addition to the model.xafml in the win project? Nevertheless right now, the ModelViewInheritance does not work, when using embedded models (I have one in my agnostic module). Imho the service does not 'see' the ModelMergedDifferences nodes, because they are created 'too late'.
You mean adding an embedded model in addition to the model.xafml i
yes and the Win project should also have a ModuleBase descenant added to your Application.Modules collection
Imho the service does not 'see' the ModelMergedDifferences nodes, because they are created 'too late'.
first u add the node, then u compile then u open again the ME and it should see
note there are a few test on the package that test the runtime and they green so at least some parts should work
apologies the previous link i posted with MDO should not work in this case as it uses WhenCreateCustomUserModelDifferenceStore
this is too late merge, u need to add a new agnostic module project to host your models
var streams = modelDifferenceStores.OfType<ResourcesModelStore>()
.Select(store => {
var assembly = ((Assembly) store.GetFieldValue("assembly"));
var value = (string) store.GetFieldValue("modelDesignedDiffsName");
var name = assembly.GetManifestResourceNames().FirstOrDefault(s => s.EndsWith(value));
return name != null ? (stream:assembly.GetManifestResourceStream(name),assembly,modelName:value) : default;
})
.WhereNotDefault();
modifying this method on the ModelViewInheritanceService
to included additional emdedded models might help resolve this case
In my agnostic model I have this embedded model diff:
In the runtime model editor, the MergedDifference node is created, but for the PersistentClass1_Listview, the diff is not inherited/merged:
But for the PersistentClass2_ListView (with a MergedDifference node created in the embedded resource model), the diff is merged:
assuimng u already
first u add the node, then u compile then u open again the ME and it should see
unfortunately i cannot help u unless i spent time debugging it
No problem, it's not that urgentl
it should be rather easy to debug it yourself is just one method CreateUnchangeableLayer
and u know how to compile now. In any case if u attempt it let me know please so we do not double spent resources
I already tried to debug. In CreateUnchangeableLayer you load the embedded models and try to get 'rules'. But nodes added in the WhenGeneratingModelNodes
are not 'physically' added to the models. Am I wrong?
as far as I remember was some model layers reposition, that is collecting the diffs and position them in the generation layer, not sure if this funcationality works, but should given that u said:
But for the PersistentClass2_ListView (with a MergedDifference node created in the embedded resource model), the diff is merged:
and as I understand u having problems merging views of different types e.g. BaseListView
u having problems merging views of different types e.g. BaseListView I'm having problems, when trying to setup the merging 'dynamically' in the the Setup(...) override. Adding the merging directly/physically in the model is working fine. Actually I'm trying to combine cloning and merging (based on some conditions) and therefore I need this dynamic/runtime approach
hopefully your sample demos your problem clear enough, if not please repost it
I upgrade Harmony and restore design time for all related packages e.g. ModelViewInheritance
, ModelMapper
etc. In my tests I see no issues for both Xpand or native ModelEditors. However the approach of the doc is not implemented you can use the model for now
that for the next minor
The pre-release 4.221.5.0 in the Reactive.XAF lab
branch includes commits that relate to this task:
To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.
If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.
Thanks a lot for your contribution.
Closing issue for age. Feel free to reopen it at any time.
.Thank you for your contribution.
I'm trying to use your ModelViewInheritance module similar to the sample linked on the documentation (https://www.youtube.com/watch?v=uh4SMPwJ5pU). Unfortunately this does not seem to work.
I think the problem is, that ModelViewInheritanceService.CreateUnchangeableLayer() is executed before IModelMergedDifferences nodes are created in the moduleManager.WhenGeneratingModelNodes(){...}.