From 1a87bc5516ce7ba4b5b06c06184d001a66dc6159 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Tue, 6 Aug 2013 14:15:55 +0200 Subject: [PATCH] TypeFinder in XamlDesigner Addin did not load the Referenced DLL's, so the Type finder could not find the Controls -> For Example DocumentView in XamlDesigner Example Project did not find AvalonEdit Component! --- .../WpfDesign.AddIn/Src/MyTypeFinder.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs index 82a6b0f8a8..6de774b64e 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs @@ -21,6 +21,27 @@ namespace ICSharpCode.WpfDesign.AddIn MyTypeFinder f = new MyTypeFinder(); f.file = file; f.ImportFrom(CreateWpfTypeFinder()); + + var pc = MyTypeFinder.GetProjectContent(file); + foreach (var referencedProjectContent in pc.ThreadSafeGetReferencedContents()) { + try{ + string fileName = null; + if (referencedProjectContent is ParseProjectContent) + { + var prj = ((ParseProjectContent)referencedProjectContent).Project as AbstractProject; + if (prj != null) + fileName = prj.OutputAssemblyFullPath; + } + else if (referencedProjectContent is ReflectionProjectContent) + { + fileName = ((ReflectionProjectContent) referencedProjectContent).AssemblyLocation; + } + var assembly = Assembly.LoadFrom(fileName); + f.RegisterAssembly(assembly); + } + catch (Exception ex) + {} + } return f; }