|
|
|
@ -29,7 +29,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
@@ -29,7 +29,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
|
|
|
|
|
/// A service provider that provides the IProvideValueTarget and IXamlTypeResolver services.
|
|
|
|
|
/// No other services (e.g. from the document's service provider) are offered.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class XamlObjectServiceProvider : IServiceProvider, IProvideValueTarget, IXamlSchemaContextProvider, IAmbientProvider |
|
|
|
|
public class XamlObjectServiceProvider : IServiceProvider, IXamlNameResolver, IProvideValueTarget, IXamlSchemaContextProvider, IAmbientProvider |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a new XamlObjectServiceProvider instance.
|
|
|
|
@ -71,6 +71,11 @@ namespace ICSharpCode.WpfDesign.XamlDom
@@ -71,6 +71,11 @@ namespace ICSharpCode.WpfDesign.XamlDom
|
|
|
|
|
if (serviceType == typeof(IAmbientProvider)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (serviceType == typeof(IXamlNameResolver)) |
|
|
|
|
{ |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -181,5 +186,55 @@ namespace ICSharpCode.WpfDesign.XamlDom
@@ -181,5 +186,55 @@ namespace ICSharpCode.WpfDesign.XamlDom
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IXamlNameResolver
|
|
|
|
|
|
|
|
|
|
public object Resolve(string name) |
|
|
|
|
{ |
|
|
|
|
INameScope ns = null; |
|
|
|
|
var xamlObj = this.XamlObject; |
|
|
|
|
while (xamlObj != null) |
|
|
|
|
{ |
|
|
|
|
ns = NameScopeHelper.GetNameScopeFromObject(xamlObj.Instance); |
|
|
|
|
|
|
|
|
|
if (ns != null) |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
xamlObj = xamlObj.ParentObject; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var obj = ns.FindName(name); |
|
|
|
|
|
|
|
|
|
return obj; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public object Resolve(string name, out bool isFullyInitialized) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public object GetFixupToken(IEnumerable<string> names) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public object GetFixupToken(IEnumerable<string> names, bool canAssignDirectly) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<KeyValuePair<string, object>> GetAllNamesAndValuesInScope() |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsFixupTokenAvailable |
|
|
|
|
{ |
|
|
|
|
get { throw new NotImplementedException(); } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public event EventHandler OnNameScopeInitializationComplete; |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|