A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
832 B

using System;
namespace Avalonia.PropertyStore
{
internal class ImmediateValueEntry<T> : IValueEntry<T>, IDisposable
{
private readonly ImmediateValueFrame _owner;
private readonly T _value;
public ImmediateValueEntry(
ImmediateValueFrame owner,
StyledPropertyBase<T> property,
T value)
{
_owner = owner;
_value = value;
Property = property;
}
public StyledPropertyBase<T> Property { get; }
public bool HasValue => true;
AvaloniaProperty IValueEntry.Property => Property;
public void Unsubscribe() { }
public void Dispose() => _owner.OnEntryDisposed(this);
object? IValueEntry.GetValue() => _value;
T IValueEntry<T>.GetValue() => _value;
}
}