Browse Source
When a `TemplateBinding` is used as a `Setter.Value`, then we need to make sure we don't use the `TemplateBinding` itself as the binding because this can cause a memory leak. Replace `IRequiresTemplateInSetter` with `ISetterValue` which can be used to require a template in the setter for `Control` and can also be used to notify `TemplateBinding` that it's in a setter and so should always clone itself. Fixes #2420pull/2438/head
6 changed files with 41 additions and 31 deletions
@ -1,10 +0,0 @@ |
|||
namespace Avalonia.Styling |
|||
{ |
|||
/// <summary>
|
|||
/// This is an interface for advanced scenarios to assist users in correct style development.
|
|||
/// You as a user will not need to use this interface directly.
|
|||
/// </summary>
|
|||
public interface IRequiresTemplateInSetter |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
namespace Avalonia.Styling |
|||
{ |
|||
/// <summary>
|
|||
/// Customizes the behavior of a class when added as a value to an <see cref="ISetter"/>.
|
|||
/// </summary>
|
|||
public interface ISetterValue |
|||
{ |
|||
/// <summary>
|
|||
/// Notifies that the object has been added as a setter value.
|
|||
/// </summary>
|
|||
void Initialize(ISetter setter); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue