Browse Source

- Parse of App.Xaml

- Parse of Frameworktemplates wich have References to Parent Resources (not yet App.Xaml Resources)
- Fixes in Xaml Parser (Attached Events, Attached Properties not always have both, a Setter and a Getter)
pull/604/head
jogibear9988 11 years ago
parent
commit
0ee80f83cc
  1. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs
  2. 47
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs
  3. 20
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs
  4. 121
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/TemplateHelper.cs
  5. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObjectServiceProvider.cs
  6. 58
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs
  7. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs
  8. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs

@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
@ -73,6 +74,21 @@ namespace ICSharpCode.WpfDesign.AddIn
} }
} }
public override Uri ConvertUriToLocalUri(Uri uri)
{
if (!uri.IsAbsoluteUri)
{
var compilation = SD.ParserService.GetCompilationForFile(file.FileName);
var assembly = this.typeResolutionService.LoadAssembly(compilation.MainAssembly);
var prj = SD.ProjectService.CurrentProject;
var newUri = new Uri(("file://" + Path.Combine(prj.Directory, uri.OriginalString)).Replace("\\","/"), UriKind.RelativeOrAbsolute);
return newUri;
}
return uri;
}
Assembly FindAssemblyInProjectReferences(string name) Assembly FindAssemblyInProjectReferences(string name)
{ {
IProject pc = GetProject(file); IProject pc = GetProject(file);

47
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs

@ -22,6 +22,7 @@ using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@ -32,6 +33,7 @@ using System.Xml;
using ICSharpCode.Core.Presentation; using ICSharpCode.Core.Presentation;
using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Designer;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
@ -44,6 +46,7 @@ using ICSharpCode.WpfDesign.Designer.OutlineView;
using ICSharpCode.WpfDesign.Designer.PropertyGrid; using ICSharpCode.WpfDesign.Designer.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
using ICSharpCode.WpfDesign.Designer.Xaml; using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.XamlDom;
namespace ICSharpCode.WpfDesign.AddIn namespace ICSharpCode.WpfDesign.AddIn
{ {
@ -60,6 +63,10 @@ namespace ICSharpCode.WpfDesign.AddIn
this.TabPageText = "${res:FormsDesigner.DesignTabPages.DesignTabPage}"; this.TabPageText = "${res:FormsDesigner.DesignTabPages.DesignTabPage}";
this.IsActiveViewContentChanged += OnIsActiveViewContentChanged; this.IsActiveViewContentChanged += OnIsActiveViewContentChanged;
var compilation = SD.ParserService.GetCompilationForFile(file.FileName);
_path = Path.GetDirectoryName(compilation.MainAssembly.UnresolvedAssembly.Location);
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
} }
static WpfViewContent() static WpfViewContent()
@ -101,6 +108,8 @@ namespace ICSharpCode.WpfDesign.AddIn
if (outline != null) { if (outline != null) {
outline.Root = null; outline.Root = null;
} }
using (XmlTextReader r = new XmlTextReader(stream)) { using (XmlTextReader r = new XmlTextReader(stream)) {
XamlLoadSettings settings = new XamlLoadSettings(); XamlLoadSettings settings = new XamlLoadSettings();
settings.DesignerAssemblies.Add(typeof(WpfViewContent).Assembly); settings.DesignerAssemblies.Add(typeof(WpfViewContent).Assembly);
@ -129,9 +138,46 @@ namespace ICSharpCode.WpfDesign.AddIn
} catch (Exception e) { } catch (Exception e) {
this.UserContent = new WpfDocumentError(e); this.UserContent = new WpfDocumentError(e);
} }
try{
var appXaml = SD.ProjectService.CurrentProject.Items.FirstOrDefault(x=>x.FileName.GetFileName().ToLower() == ("app.xaml"));
if (appXaml!=null){
var f=appXaml as FileProjectItem;
OpenedFile a = SD.FileService.GetOrCreateOpenedFile(f.FileName);
var xml = XmlReader.Create(a.OpenRead());
var doc=new XmlDocument();
doc.Load(xml);
var node = doc.FirstChild.ChildNodes.Cast<XmlNode>().FirstOrDefault(x=>x.Name=="Application.Resources");
foreach (XmlAttribute att in doc.FirstChild.Attributes.Cast<XmlAttribute>().ToList())
{
if (att.Name.StartsWith("xmlns"))
node.Attributes.Append(att);
}
var appXamlXml = XmlReader.Create(new StringReader(node.InnerXml));
var parsed = XamlParser.Parse(appXamlXml, ((XamlDesignContext) designer.DesignContext).ParserSettings);
var dict = (ResourceDictionary)parsed.RootInstance;
designer.DesignPanel.Resources.MergedDictionaries.Add(dict);
}
}
catch (Exception)
{ }
} }
} }
System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
var assemblyName = (new AssemblyName(args.Name));
string fileName = Path.Combine(_path, assemblyName.Name) + ".dll";
if (File.Exists(fileName))
return typeResolutionService.LoadAssembly(fileName);
return null;
}
private TypeResolutionService typeResolutionService = new TypeResolutionService();
private string _path;
private MemoryStream _stream; private MemoryStream _stream;
bool wasChangedInDesigner; bool wasChangedInDesigner;
@ -285,6 +331,7 @@ namespace ICSharpCode.WpfDesign.AddIn
public override void Dispose() public override void Dispose()
{ {
AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
SD.ProjectService.ProjectItemAdded -= OnReferenceAdded; SD.ProjectService.ProjectItemAdded -= OnReferenceAdded;
propertyContainer.Clear(); propertyContainer.Clear();

20
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs

@ -504,6 +504,26 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
</Window>"); </Window>");
} }
[Test]
public void Template2()
{
TestLoading(@"<Window xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<Window.Resources>
<ResourceDictionary>
<SolidColorBrush Color=""Blue"" x:Key=""bb"" />
<ControlTemplate x:Key=""aa"" TargetType=""Button"">
<Grid HorizontalAlignment=""Left"">
<Rectangle Fill=""{StaticResource bb}"" />
</Grid>
</ControlTemplate>
</ResourceDictionary>
</Window.Resources>
</Window>");
}
[Test] [Test]
public void ListBox1() public void ListBox1()

121
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/TemplateHelper.cs

@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -24,39 +25,119 @@ using System.Reflection;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Markup; using System.Windows.Markup;
using System.Xaml;
using System.Xml; using System.Xml;
using System.Xml.XPath; using System.Xml.XPath;
namespace ICSharpCode.WpfDesign.XamlDom namespace ICSharpCode.WpfDesign.XamlDom
{ {
public static class TemplateHelper public class TemplateHelperResourceDictionary : ResourceDictionary, IDictionary
{ {
public static FrameworkTemplate GetFrameworkTemplate(XmlElement xmlElement) void IDictionary.Add(object key, object value)
{ {
var nav = xmlElement.CreateNavigator(); base.Add(key == null ? "$$temp&&§§%%__" : key, value);
}
}
var ns = new Dictionary<string, string>(); public static class TemplateHelper
while (true) {
public static FrameworkTemplate GetFrameworkTemplate(XmlElement xmlElement, XamlObject parentObject)
{
try
{ {
var nsInScope = nav.GetNamespacesInScope(XmlNamespaceScope.ExcludeXml); var nav = xmlElement.CreateNavigator();
foreach (var ak in nsInScope)
var ns = new Dictionary<string, string>();
while (true)
{ {
if (!ns.ContainsKey(ak.Key) && ak.Key != "") var nsInScope = nav.GetNamespacesInScope(XmlNamespaceScope.ExcludeXml);
ns.Add(ak.Key, ak.Value); foreach (var ak in nsInScope)
{
if (!ns.ContainsKey(ak.Key) && ak.Key != "")
ns.Add(ak.Key, ak.Value);
}
if (!nav.MoveToParent())
break;
} }
if (!nav.MoveToParent())
break;
}
foreach (var dictentry in ns) foreach (var dictentry in ns)
{ {
xmlElement.SetAttribute("xmlns:" + dictentry.Key, dictentry.Value); xmlElement.SetAttribute("xmlns:" + dictentry.Key, dictentry.Value);
}
var xaml = xmlElement.OuterXml;
xaml = "<tmp:TemplateHelperResourceDictionary xmlns=\"http://schemas.microsoft.com/netfx/2007/xaml/presentation\" xmlns:tmp=\"clr-namespace:ICSharpCode.WpfDesign.XamlDom;assembly=ICSharpCode.WpfDesign.XamlDom\">" + xaml + "</tmp:TemplateHelperResourceDictionary>";
StringReader stringReader = new StringReader(xaml);
XmlReader xmlReader = XmlReader.Create(stringReader);
var xamlReader = new XamlXmlReader(xmlReader, parentObject.ServiceProvider.SchemaContext);
var seti = new XamlObjectWriterSettings();
var resourceDictionary = new ResourceDictionary();
var obj = parentObject;
while (obj != null)
{
if (obj.Instance is ResourceDictionary)
{
var r = obj.Instance as ResourceDictionary;
foreach (var k in r.Keys)
{
if (!resourceDictionary.Contains(k))
resourceDictionary.Add(k, r[k]);
}
}
else if (obj.Instance is FrameworkElement)
{
var r = ((FrameworkElement)obj.Instance).Resources;
foreach (var k in r.Keys)
{
if (!resourceDictionary.Contains(k))
resourceDictionary.Add(k, r[k]);
}
}
obj = obj.ParentObject;
}
seti.BeforePropertiesHandler = (s, e) =>
{
if (seti.BeforePropertiesHandler != null)
{
var rr = e.Instance as ResourceDictionary;
rr.MergedDictionaries.Add(resourceDictionary);
seti.BeforePropertiesHandler = null;
}
};
var writer = new XamlObjectWriter(parentObject.ServiceProvider.SchemaContext, seti);
XamlServices.Transform(xamlReader, writer);
var result = (ResourceDictionary)writer.Result;
var enr = result.Keys.GetEnumerator();
enr.MoveNext();
var rdKey = enr.Current;
var template = result[rdKey] as FrameworkTemplate;
result.Remove(rdKey);
return template;
} }
catch (Exception)
var xaml = xmlElement.OuterXml; { }
StringReader stringReader = new StringReader(xaml);
XmlReader xmlReader = XmlReader.Create(stringReader); return null;
return (FrameworkTemplate)XamlReader.Load(xmlReader); }
private static Stream GenerateStreamFromString(string s)
{
MemoryStream stream = new MemoryStream();
StreamWriter writer = new StreamWriter(stream);
writer.Write(s);
writer.Flush();
stream.Position = 0;
return stream;
} }
} }
} }

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObjectServiceProvider.cs

@ -136,7 +136,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
{ {
get get
{ {
return iCsharpXamlSchemaContext = iCsharpXamlSchemaContext ?? new XamlSchemaContext(); return iCsharpXamlSchemaContext = iCsharpXamlSchemaContext ?? System.Windows.Markup.XamlReader.GetWpfSchemaContext(); // new XamlSchemaContext();
} }
} }

58
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs

@ -146,6 +146,8 @@ namespace ICSharpCode.WpfDesign.XamlDom
static Type FindType(XamlTypeFinder typeFinder, string namespaceUri, string localName) static Type FindType(XamlTypeFinder typeFinder, string namespaceUri, string localName)
{ {
Type elementType = typeFinder.GetType(namespaceUri, localName); Type elementType = typeFinder.GetType(namespaceUri, localName);
if (elementType == null)
elementType = typeFinder.GetType(namespaceUri, localName+"Extension");
if (elementType == null) if (elementType == null)
throw new XamlLoadException("Cannot find type " + localName + " in " + namespaceUri); throw new XamlLoadException("Cannot find type " + localName + " in " + namespaceUri);
return elementType; return elementType;
@ -195,7 +197,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
if (typeof (FrameworkTemplate).IsAssignableFrom(elementType)) if (typeof (FrameworkTemplate).IsAssignableFrom(elementType))
{ {
var xamlObj = new XamlObject(document, element, elementType, TemplateHelper.GetFrameworkTemplate(element)); var xamlObj = new XamlObject(document, element, elementType, TemplateHelper.GetFrameworkTemplate(element, currentXamlObject));
xamlObj.ParentObject = currentXamlObject; xamlObj.ParentObject = currentXamlObject;
return xamlObj; return xamlObj;
} }
@ -323,8 +325,11 @@ namespace ICSharpCode.WpfDesign.XamlDom
if (defaultProperty == null && obj.Instance != null && CollectionSupport.IsCollectionType(obj.Instance.GetType())) { if (defaultProperty == null && obj.Instance != null && CollectionSupport.IsCollectionType(obj.Instance.GetType())) {
XamlObject parentObj = obj.ParentObject; XamlObject parentObj = obj.ParentObject;
var parentElement = element.ParentNode; var parentElement = element.ParentNode;
XamlPropertyInfo propertyInfo = GetPropertyInfo(settings.TypeFinder, parentObj.Instance, parentObj.ElementType, parentElement.NamespaceURI, parentElement.LocalName); XamlPropertyInfo propertyInfo;
collectionProperty = FindExistingXamlProperty(parentObj, propertyInfo); if (parentObj != null) {
propertyInfo = GetPropertyInfo(settings.TypeFinder, parentObj.Instance, parentObj.ElementType, parentElement.NamespaceURI, parentElement.LocalName);
collectionProperty = FindExistingXamlProperty(parentObj, propertyInfo);
}
collectionInstance = obj.Instance; collectionInstance = obj.Instance;
collectionType = obj.ElementType; collectionType = obj.ElementType;
collectionPropertyElement = element; collectionPropertyElement = element;
@ -500,6 +505,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
if (eventInfo != null) { if (eventInfo != null) {
return new XamlEventPropertyInfo(eventInfo); return new XamlEventPropertyInfo(eventInfo);
} }
throw new XamlLoadException("property " + propertyName + " not found"); throw new XamlLoadException("property " + propertyName + " not found");
} }
@ -507,23 +513,42 @@ namespace ICSharpCode.WpfDesign.XamlDom
{ {
MethodInfo getMethod = elementType.GetMethod("Get" + propertyName, BindingFlags.Public | BindingFlags.Static); MethodInfo getMethod = elementType.GetMethod("Get" + propertyName, BindingFlags.Public | BindingFlags.Static);
MethodInfo setMethod = elementType.GetMethod("Set" + propertyName, BindingFlags.Public | BindingFlags.Static); MethodInfo setMethod = elementType.GetMethod("Set" + propertyName, BindingFlags.Public | BindingFlags.Static);
if (getMethod != null && setMethod != null) { if (getMethod != null || setMethod != null) {
FieldInfo field = elementType.GetField(propertyName + "Property", BindingFlags.Public | BindingFlags.Static); FieldInfo field = elementType.GetField(propertyName + "Property", BindingFlags.Public | BindingFlags.Static);
if (field != null && field.FieldType == typeof(DependencyProperty)) { if (field != null && field.FieldType == typeof(DependencyProperty)) {
return new XamlDependencyPropertyInfo((DependencyProperty)field.GetValue(null), true); return new XamlDependencyPropertyInfo((DependencyProperty)field.GetValue(null), true);
} }
} }
if (elementType.BaseType != null) { if (elementType.BaseType != null) {
return TryFindAttachedProperty(elementType.BaseType, propertyName); return TryFindAttachedProperty(elementType.BaseType, propertyName);
} }
return null; return null;
} }
internal static XamlPropertyInfo TryFindAttachedEvent(Type elementType, string propertyName)
{
FieldInfo fieldEvent = elementType.GetField(propertyName + "Event", BindingFlags.Public | BindingFlags.Static);
if (fieldEvent != null && fieldEvent.FieldType == typeof(RoutedEvent))
{
return new XamlEventPropertyInfo(TypeDescriptor.GetEvents(elementType)[propertyName]);
}
if (elementType.BaseType != null)
{
return TryFindAttachedEvent(elementType.BaseType, propertyName);
}
return null;
}
static XamlPropertyInfo FindAttachedProperty(Type elementType, string propertyName) static XamlPropertyInfo FindAttachedProperty(Type elementType, string propertyName)
{ {
XamlPropertyInfo pi = TryFindAttachedProperty(elementType, propertyName); XamlPropertyInfo pi = TryFindAttachedProperty(elementType, propertyName);
if (pi == null) {
pi = TryFindAttachedEvent(elementType, propertyName);
}
if (pi != null) { if (pi != null) {
return pi; return pi;
} else { } else {
@ -555,7 +580,12 @@ namespace ICSharpCode.WpfDesign.XamlDom
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName); return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
} else if (attribute.LocalName == "IsLocked" && attribute.NamespaceURI == XamlConstants.DesignTimeNamespace) { } else if (attribute.LocalName == "IsLocked" && attribute.NamespaceURI == XamlConstants.DesignTimeNamespace) {
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName); return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
} else if (attribute.LocalName == "LayoutOverrides" && attribute.NamespaceURI == XamlConstants.DesignTimeNamespace) {
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
} else if (attribute.LocalName == "LayoutRounding" && attribute.NamespaceURI == XamlConstants.DesignTimeNamespace) {
return FindAttachedProperty(typeof(DesignTimeProperties), attribute.LocalName);
} }
return null; return null;
} }
@ -759,7 +789,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
} }
} }
} }
/// <summary> /// <summary>
/// Method use to parse a piece of Xaml. /// Method use to parse a piece of Xaml.
/// </summary> /// </summary>
@ -768,6 +798,19 @@ namespace ICSharpCode.WpfDesign.XamlDom
/// <param name="settings">Parser settings used by <see cref="XamlParser"/>.</param> /// <param name="settings">Parser settings used by <see cref="XamlParser"/>.</param>
/// <returns>Returns the XamlObject of the parsed <paramref name="xaml"/>.</returns> /// <returns>Returns the XamlObject of the parsed <paramref name="xaml"/>.</returns>
public static XamlObject ParseSnippet(XamlObject root, string xaml, XamlParserSettings settings) public static XamlObject ParseSnippet(XamlObject root, string xaml, XamlParserSettings settings)
{
return ParseSnippet(root, xaml, settings, null);
}
/// <summary>
/// Method use to parse a piece of Xaml.
/// </summary>
/// <param name="root">The Root XamlObject of the current document.</param>
/// <param name="xaml">The Xaml being parsed.</param>
/// <param name="settings">Parser settings used by <see cref="XamlParser"/>.</param>
/// <param name="parentObject">Parent Object, where the Parsed snippet will be inserted (Needed for Example for Bindings).</param>
/// <returns>Returns the XamlObject of the parsed <paramref name="xaml"/>.</returns>
public static XamlObject ParseSnippet(XamlObject root, string xaml, XamlParserSettings settings, XamlObject parentObject)
{ {
XmlTextReader reader = new XmlTextReader(new StringReader(xaml)); XmlTextReader reader = new XmlTextReader(new StringReader(xaml));
var element = root.OwnerDocument.XmlDocument.ReadNode(reader); var element = root.OwnerDocument.XmlDocument.ReadNode(reader);
@ -785,6 +828,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
parser.settings = settings; parser.settings = settings;
parser.errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink)); parser.errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink));
parser.document = root.OwnerDocument; parser.document = root.OwnerDocument;
parser.currentXamlObject = parentObject;
var xamlObject = parser.ParseObject(element as XmlElement); var xamlObject = parser.ParseObject(element as XmlElement);
RemoveRootNamespacesFromNodeAndChildNodes(root, element); RemoveRootNamespacesFromNodeAndChildNodes(root, element);

8
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs

@ -556,7 +556,13 @@ namespace ICSharpCode.WpfDesign.XamlDom
} }
} }
set { set {
propertyInfo.SetValue(parentObject.Instance, value); var setValue = value;
if (propertyInfo.ReturnType == typeof(Uri))
{
setValue = this.ParentObject.OwnerDocument.TypeFinder.ConvertUriToLocalUri((Uri)value);
}
propertyInfo.SetValue(parentObject.Instance, setValue);
if (ValueOnInstanceChanged != null) if (ValueOnInstanceChanged != null)
ValueOnInstanceChanged(this, EventArgs.Empty); ValueOnInstanceChanged(this, EventArgs.Empty);
} }

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs

@ -277,6 +277,11 @@ namespace ICSharpCode.WpfDesign.XamlDom
return WpfTypeFinder.Instance.Clone(); return WpfTypeFinder.Instance.Clone();
} }
public virtual Uri ConvertUriToLocalUri(Uri uri)
{
return uri;
}
static class WpfTypeFinder static class WpfTypeFinder
{ {
internal static readonly XamlTypeFinder Instance; internal static readonly XamlTypeFinder Instance;
@ -291,6 +296,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
Instance.RegisterAssembly(typeof(IAddChild).Assembly); // PresentationCore Instance.RegisterAssembly(typeof(IAddChild).Assembly); // PresentationCore
Instance.RegisterAssembly(typeof(XamlReader).Assembly); // PresentationFramework Instance.RegisterAssembly(typeof(XamlReader).Assembly); // PresentationFramework
Instance.RegisterAssembly(typeof(XamlType).Assembly); // System.Xaml Instance.RegisterAssembly(typeof(XamlType).Assembly); // System.Xaml
Instance.RegisterAssembly(typeof(Type).Assembly); // mscorelib
} }
} }
} }

Loading…
Cancel
Save