Application is XAF Winforms only.
In regards to https://www.devexpress.com/Support/Center/Question/Details/S19870
I have modified my code as described in the description. Specifically:
* In my Windows Forms Application Project, I have added calls to SetIdPrefix in my Program.cs file for each class that has a conflict, for example:
ModelNodesGeneratorSettings.SetIdPrefix(typeof(Sil.Png.PartTracker.Wizards.Batch.AuthorizeInvalidPurchaseOrder.Finish), "AuthorizeInvalidPurchaseOrder.Finish");
ModelNodesGeneratorSettings.SetIdPrefix(typeof(Sil.Png.PartTracker.Wizards.Batch.RequestInvalidPurchaseOrder.Finish), "RequestInvalidPurchaseOrder.Finish");
* I have edited my xafml files to fix the differences that references all of the above classes, for example:
<DetailView Id="AuthorizeInvalidPurchaseOrder.Finish_DetailView" FreezeLayout="True">
These xafml files are in my Module Project and my Windows Forms Module Project.
It works fine when I execute the program. I have only verified that it starts up, I have not visited all the views involved. But that seems sufficient because I was getting startup errors until I added the calls to SetPrefixId.
The problem is that I cannot use the Update Model nor can I edit the model without getting an error. The error text is:
Error:
There is already node with Id 'Finish_ListView'. The node: Application/Views/Finish_ListView.
Update failed
When I attempt to edit the model I get the above internal error message with a warning that I should not edit the model. Then the model editor opens and I can browse around. Drilling down into the views I see this:
Quite clearly, the SetPrefixId calls have had no effect on the design-time environment. That makes a lot of sense to me since they are in different assemblies.
On a hunch, I added the same set of calls to SetIdPrefix into my Module Project, Module.cs, in the constructor just before the call to InitializeComponent(). That changed the behavior! I no longer have any errors on Update Model or opening the model editor. However some of my nodes are now in the unusablenodes.xml file. I suspect that is a different issue for me to resolve (we have had a lot of turmoil on our class hierarchy so it wouldn't surprise me). I'll investigate the unusable nodes tomorrow and I'll take this as a successful trial. I conclude somewhere in my module I need to call SetIdPrefix.
Now I don't want to just hack that in there without your input. Given all of this, what do I need to do to have the design-time environment and the actual program work correctly?
Where are we really supposed to call SetIdPrefix? Does it need to be in multiple places (modules?)?
Thank you,
Steve
oops, I had pasted a screen snip in the editor but it didn't make it into the posting. I already closed snip and have changed my code so I'll just describe it. The snip showed the Views section of the model. It had the AuthorizeInvalidPurchaseOrder namespace with a Finish_DetailView, it did not use AuthorizeInvalidPurchaseOrder.Finish like my call to SetIdPrefix requested. The namespace RequestInvalidPurchaseOrder had views defined up to just before the Finish class would have been encountered showing that the error came while attempting to process that class.
I have reviewed and resolve all of the unusable nodes. They were all cost by name changes unrelated to this issue. Therefore, it appears that I can replicate the calls to SetIdPrefix in every module that has any of the views with conflicting names. This seems to make the Update Model, model editor and application startup all processed the model in the same way. I've not extensively tested the application at this point to prove that everything works fine. While this seems to be a functional solution it is obviously not desirable. I will wait for your response before going further.