Browse Source
Merge pull request #3024 from miloszkukla/master
Allow to use object as a resource key in Static/DynamicResourceExtension + Rename ResourceProviderExtensions to ResourceNodeExtensions
pull/3052/head
Steven Kirk
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
4 additions and
4 deletions
-
src/Avalonia.Styling/Controls/ResourceNodeExtensions.cs
-
src/Markup/Avalonia.Markup.Xaml/MarkupExtensions/DynamicResourceExtension.cs
-
src/Markup/Avalonia.Markup.Xaml/MarkupExtensions/StaticResourceExtension.cs
|
|
|
@ -3,7 +3,7 @@ using Avalonia.Reactive; |
|
|
|
|
|
|
|
namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
public static class ResourceProviderExtensions |
|
|
|
public static class ResourceNodeExtensions |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Finds the specified resource by searching up the logical tree and then global styles.
|
|
|
|
@ -18,7 +18,7 @@ namespace Avalonia.Markup.Xaml.MarkupExtensions |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public DynamicResourceExtension(string resourceKey) |
|
|
|
public DynamicResourceExtension(object resourceKey) |
|
|
|
{ |
|
|
|
ResourceKey = resourceKey; |
|
|
|
} |
|
|
|
|
|
|
|
@ -16,12 +16,12 @@ namespace Avalonia.Markup.Xaml.MarkupExtensions |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public StaticResourceExtension(string resourceKey) |
|
|
|
public StaticResourceExtension(object resourceKey) |
|
|
|
{ |
|
|
|
ResourceKey = resourceKey; |
|
|
|
} |
|
|
|
|
|
|
|
public string ResourceKey { get; set; } |
|
|
|
public object ResourceKey { get; set; } |
|
|
|
|
|
|
|
public object ProvideValue(IServiceProvider serviceProvider) |
|
|
|
{ |
|
|
|
|