|
|
|
@ -14,7 +14,7 @@ namespace Avalonia.Controls |
|
|
|
/// <param name="control">The control.</param>
|
|
|
|
/// <param name="key">The resource key.</param>
|
|
|
|
/// <returns>The resource, or <see cref="AvaloniaProperty.UnsetValue"/> if not found.</returns>
|
|
|
|
public static object FindResource(this IResourceProvider control, string key) |
|
|
|
public static object FindResource(this IResourceNode control, string key) |
|
|
|
{ |
|
|
|
Contract.Requires<ArgumentNullException>(control != null); |
|
|
|
Contract.Requires<ArgumentNullException>(key != null); |
|
|
|
@ -23,7 +23,7 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
while (current != null) |
|
|
|
{ |
|
|
|
if (current is IResourceProvider host) |
|
|
|
if (current is IResourceNode host) |
|
|
|
{ |
|
|
|
if (host.TryGetResource(key, out var value)) |
|
|
|
{ |
|
|
|
@ -37,7 +37,7 @@ namespace Avalonia.Controls |
|
|
|
return AvaloniaProperty.UnsetValue; |
|
|
|
} |
|
|
|
|
|
|
|
public static IObservable<object> GetResourceObservable(this IResourceProvider target, string key) |
|
|
|
public static IObservable<object> GetResourceObservable(this IResourceNode target, string key) |
|
|
|
{ |
|
|
|
return Observable.FromEventPattern<ResourcesChangedEventArgs>( |
|
|
|
x => target.ResourcesChanged += x, |
|
|
|
|