committed by
GitHub
35 changed files with 175 additions and 138 deletions
@ -0,0 +1,18 @@ |
|||||
|
using Avalonia.Styling; |
||||
|
|
||||
|
namespace Avalonia.Diagnostics |
||||
|
{ |
||||
|
public class AppliedStyle |
||||
|
{ |
||||
|
private readonly IStyleInstance _instance; |
||||
|
|
||||
|
internal AppliedStyle(IStyleInstance instance) |
||||
|
{ |
||||
|
_instance = instance; |
||||
|
} |
||||
|
|
||||
|
public bool HasActivator => _instance.HasActivator; |
||||
|
public bool IsActive => _instance.IsActive; |
||||
|
public StyleBase Style => (StyleBase)_instance.Source; |
||||
|
} |
||||
|
} |
||||
@ -1,24 +0,0 @@ |
|||||
using System; |
|
||||
using Avalonia.Metadata; |
|
||||
|
|
||||
namespace Avalonia.Styling |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// Represents a setter for a <see cref="Style"/>.
|
|
||||
/// </summary>
|
|
||||
[NotClientImplementable] |
|
||||
public interface ISetter |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// Instances a setter on a control.
|
|
||||
/// </summary>
|
|
||||
/// <param name="styleInstance">The style which contains the setter.</param>
|
|
||||
/// <param name="target">The control.</param>
|
|
||||
/// <returns>An <see cref="ISetterInstance"/>.</returns>
|
|
||||
/// <remarks>
|
|
||||
/// This method should return an <see cref="ISetterInstance"/> which can be used to apply
|
|
||||
/// the setter to the specified control.
|
|
||||
/// </remarks>
|
|
||||
ISetterInstance Instance(IStyleInstance styleInstance, StyledElement target); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,12 @@ |
|||||
|
namespace Avalonia.Styling |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Represents the base class for value setters.
|
||||
|
/// </summary>
|
||||
|
public abstract class SetterBase |
||||
|
{ |
||||
|
internal abstract ISetterInstance Instance( |
||||
|
IStyleInstance styleInstance, |
||||
|
StyledElement target); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue