I am developing a Revit addin utilizing the Prism library as my MVVM/IOC framework. The addin relies heavily on Prism's DialogService to display various dialogs for several tools.
I want to avoid hard-coding dialog names whenever using the IDialogService.ShowDialog(dialogName, dialogParams, callBackAction)
function.
So I am thinking of introducing a static class in the abstraction layer that holds the names of all the dialogs defined in the UI layer assembly.
Instead of maintaining this class manually, is there a way to equip my solution with a code generator that will update this class whenever I:
- Add a new dialog sub-class to the UI project? Or
- Register a new dialog with the
IContainerRegistry.RegisterDialog<DlgUserControlType, DlgViewModelType>()
?
I'm not sure if this is a naive approach, so please feel free to point out any "smell" in it.