Topic Author
Posts: 1
Joined: 25 Mar 2015, 20:59

Loading XAML with class in runtime

27 Mar 2015, 00:15


I am about to buy a real indy license of Noesis, but would like to know if following is possible:

Scenario: I want to be able to create modules for my game, that are loaded in runtime, without rebuilding the main application.

I have understood that I will be able generate .nsb files, and that they contain the GUI-content (XAML). I have also understood the XAML files can reference an x:Class (as in a user control), but will they also be able to contain the referenced x:Class? Or do I have to rebuild the entire main application with this class, before it's possible to load the nsb file in runtime?

I do not consider it to be a real "mod" if I have to release a new update to the game whenever a new mod is available for the user.
User avatar
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18

Re: Loading XAML with class in runtime

27 Mar 2015, 12:25

NSB files is the format used by noesisGUI to store preprocessed resources. This is the format that the runtime understands. Each XAML must be converted to NSB, this is done automatically by Unity (result is stored in the /StreamingAssets folder) or by using the BuildTool in the C++ SDK.

If you have a x:Class in the XAML we serialize this class inside the NSB. But this is not the class itself. For your modular approach using x:Class you would need to send the NSB + DLL containing the new class. You would need to manage the loading of this DLL in your application. Note that in AOT platforms (like iOS) this is probably forbidden.

I recommend you a different approach. You can avoid x:Class at all and use DataBinding. That way, your application exposes a context that any XAML can bind as they wish.

I think with this approach you can achieve a decent modding architecture. I know there are several users following this approach.

Who is online

Users browsing this forum: No registered users and 1 guest