Code-Behind in Referenced Assembly
Hi all,
When I use a code-behind class which is in the executing assembly it works fine (e.g. x:Class="CurrentAssemblyNamespace.MainWindow"), however if the class is in a referenced assembly it cannot be found (e.g. (e.g. x:Class="ReferencedAssemblyNamespace.MainWindow")).
Is this expected behaviour, or am I doing something wrong?
I have multiple projects (executable assemblies) based on the different platforms that are being supported, and keeping copies of all of the code-behind classes in each is not feasible.
Thanks,
Mark
When I use a code-behind class which is in the executing assembly it works fine (e.g. x:Class="CurrentAssemblyNamespace.MainWindow"), however if the class is in a referenced assembly it cannot be found (e.g. (e.g. x:Class="ReferencedAssemblyNamespace.MainWindow")).
Is this expected behaviour, or am I doing something wrong?
I have multiple projects (executable assemblies) based on the different platforms that are being supported, and keeping copies of all of the code-behind classes in each is not feasible.
Thanks,
Mark
Re: Code-Behind in Referenced Assembly
We are not loading assemblies (should we?) but if the assembly is already loaded it should work. Could you try it? Also, could you try without specifying the assembly name?
Re: Code-Behind in Referenced Assembly
Thank you, you hit the nail on the head.
I had not used any classes within the assembly before loading the Xaml, and so the CLR had not loaded the assembly.
If I use a class in the assembly, or load it with AppDomain.CurrentDomain.Load, then the Xaml works.
I can account for this in my code, so all is good.
I had not used any classes within the assembly before loading the Xaml, and so the CLR had not loaded the assembly.
If I use a class in the assembly, or load it with AppDomain.CurrentDomain.Load, then the Xaml works.
I can account for this in my code, so all is good.
Re: Code-Behind in Referenced Assembly
Thanks for the feedback Mark. WPF is loading the assembly so I think we should probably do the same, could you please open a ticket?
Who is online
Users browsing this forum: No registered users and 2 guests