Loading UI components at runtime from a .dll #8670
Replies: 3 comments
-
Same problem here .... If a solution is found, please share :-) |
Beta Was this translation helpful? Give feedback.
-
There are a couple of things that get put in place at compile time that do not get set properly if you reference the control dynamically at runtime. If you look at the .pri files involved. As an example:
This is the resources of a component. This was dumped from the .pri file using makepri.
This is without the control referenced.
This is with the control referenced.
While this is C++, C# should do something similar.
This would mean that in order to be able to dynamically load a control, you would have to be able to dynamically load and merge .pri files, translating the control paths as needed. You would also have to dynamically add providers to the application's metadata provider list. If you do some extra work with InitializeComponent in your applications App class, I'm sure you could get the metadata provider to work, but it is the resources that is currently the problem. |
Beta Was this translation helpful? Give feedback.
-
I think you are hitting this known bug that has been around for years: #6299 Very important bug, but still not fixed. |
Beta Was this translation helpful? Give feedback.
-
Hey there, I was just wondering if anyone had figured out a way to load .xaml from a dll at runtime? I have no way of referencing the .dlls at compile time, but I still want to load them once the program has started, either a usercontrol or page.
Beta Was this translation helpful? Give feedback.
All reactions