In my database, I have a table that contains different userControls with the attributes "ClassName", "AssemblyName" and "NameSpace", which are necessary to initialize instances using reflection.
My idea: to collect this collection from the database, set the collection as a data context and dynamically load these user elements into tabcontrol. I could use a "tabItem", which will contain it at runtime in the code for loading. I think it would be very convenient and fantastic if it could be done directly from XAML in the template.
I was looking for something similar, but could not find anything without using the code.
I thought something like the following
<TabControl.ContentTemplate> <DataTemplate> <xxxControl ClassName="{Binding ClassName}" AssemblyName="{Binding AssemblyName}" NameSpace="{Binding NameSpace}" /> </DataTemplate> </TabControl.ContentTemplate>
I could create such an "xxxControl", but that would be a waste of time if something like that already exists. Thus, the GUI can be fully generated by the parameters in the database.
source share