Browse Source
We need to make sure to set up the bindings as soon as the setter is instanced, even if it's not activated immediately.pull/3636/head
10 changed files with 360 additions and 90 deletions
@ -1,20 +1,40 @@ |
|||||
#nullable enable |
#nullable enable |
||||
|
|
||||
|
using System; |
||||
|
|
||||
namespace Avalonia.Styling |
namespace Avalonia.Styling |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// Represents a setter that has been instanced on a control.
|
/// Represents a setter that has been instanced on a control.
|
||||
/// </summary>
|
/// </summary>
|
||||
public interface ISetterInstance |
public interface ISetterInstance : IDisposable |
||||
{ |
{ |
||||
|
/// <summary>
|
||||
|
/// Starts the setter instance.
|
||||
|
/// </summary>
|
||||
|
/// <param name="hasActivator">Whether the parent style has an activator.</param>
|
||||
|
/// <remarks>
|
||||
|
/// If <paramref name="hasActivator"/> is false then the setter should be immediately
|
||||
|
/// applied and <see cref="Activate"/> and <see cref="Deactivate"/> should not be called.
|
||||
|
/// If true, then bindings etc should be initiated but not produce a value until
|
||||
|
/// <see cref="Activate"/> called.
|
||||
|
/// </remarks>
|
||||
|
public void Start(bool hasActivator); |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Activates the setter.
|
/// Activates the setter.
|
||||
/// </summary>
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// Should only be called if hasActivator was true when <see cref="Start(bool)"/> was called.
|
||||
|
/// </remarks>
|
||||
public void Activate(); |
public void Activate(); |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Deactivates the setter.
|
/// Deactivates the setter.
|
||||
/// </summary>
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// Should only be called if hasActivator was true when <see cref="Start(bool)"/> was called.
|
||||
|
/// </remarks>
|
||||
public void Deactivate(); |
public void Deactivate(); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue