Dynamically loaded Xap/dll - UIVisualizerService not finding window for viewmodel

Feb 2, 2012 at 9:19 PM

Using Catel 2.4. My application consists of multiple Xap files. I use UIVisualizerService.ShowDialog(viewmodel).

Since we started loading some of the Xap/dll files dynamically at runtime, the UIVisualizerService fails to find the DataWindow<TViewmModel>.

I can solve this by registering the window manually. However, I was wondering whether it is possible to trigger the UIVisualizerService to (re-)discover all windows (e.g. each time a new Xap or dll has been loaded)?

Feb 2, 2012 at 9:56 PM

No, unfortunately this is not possible because the dynamically loaded xaps are not added to the AppDomain. For now, you will have to register them manually. Starting with Catel 3.0 (beta already available), the views will be dynamically resolved by naming convention when they are needed (thus this will all work automatically, as long as the types are available to the type system of Catel).

Feb 2, 2012 at 10:11 PM

No problem. I have registered them in a static ctor of the viewmodel that has the UIVisualizerService.ShowDialog calls (so that they are only registered once).  

Glad to hear that more magic is coming in 3.0!