|
|
@ -1,9 +1,7 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Diagnostics; |
|
|
|
|
|
using Avalonia.Data; |
|
|
using Avalonia.Data; |
|
|
using Avalonia.Reactive; |
|
|
using Avalonia.Reactive; |
|
|
using Avalonia.Styling; |
|
|
using Avalonia.Styling; |
|
|
using Avalonia.Utilities; |
|
|
|
|
|
|
|
|
|
|
|
namespace Avalonia |
|
|
namespace Avalonia |
|
|
{ |
|
|
{ |
|
|
@ -12,7 +10,7 @@ namespace Avalonia |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public abstract class StyledPropertyBase<TValue> : AvaloniaProperty<TValue>, IStyledPropertyAccessor |
|
|
public abstract class StyledPropertyBase<TValue> : AvaloniaProperty<TValue>, IStyledPropertyAccessor |
|
|
{ |
|
|
{ |
|
|
private bool _inherits; |
|
|
private readonly bool _inherits; |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="StyledPropertyBase{T}"/> class.
|
|
|
/// Initializes a new instance of the <see cref="StyledPropertyBase{T}"/> class.
|
|
|
@ -243,10 +241,10 @@ namespace Avalonia |
|
|
} |
|
|
} |
|
|
else if (value is ITemplate template && !typeof(ITemplate).IsAssignableFrom(PropertyType)) |
|
|
else if (value is ITemplate template && !typeof(ITemplate).IsAssignableFrom(PropertyType)) |
|
|
{ |
|
|
{ |
|
|
return new PropertySetterLazyInstance<TValue>( |
|
|
return new PropertySetterTemplateInstance<TValue>( |
|
|
target, |
|
|
target, |
|
|
this, |
|
|
this, |
|
|
() => (TValue)template.Build()); |
|
|
template); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|