using System;
namespace Avalonia
{
///
/// A styled avalonia property.
///
public class StyledProperty : StyledPropertyBase
{
///
/// Initializes a new instance of the class.
///
/// The name of the property.
/// The type of the class that registers the property.
/// The property metadata.
/// Whether the property inherits its value.
/// A value validation callback.
/// A callback.
public StyledProperty(
string name,
Type ownerType,
StyledPropertyMetadata metadata,
bool inherits = false,
Func? validate = null,
Action? notifying = null)
: base(name, ownerType, metadata, inherits, validate, notifying)
{
}
///
/// Initializes a new instance of the class.
///
/// The property to add the owner to.
/// The type of the class that registers the property.
internal StyledProperty(StyledPropertyBase source, Type ownerType)
: base(source, ownerType)
{
}
///
/// Registers the property on another type.
///
/// The type of the additional owner.
/// The property.
public StyledProperty AddOwner() where TOwner : IAvaloniaObject
{
AvaloniaPropertyRegistry.Instance.Register(typeof(TOwner), this);
return this;
}
}
}