@ -39,12 +39,14 @@ namespace Avalonia
/// <param name="name">The name of the property.</param>
/// <param name="valueType">The type of the property's value.</param>
/// <param name="ownerType">The type of the class that registers the property.</param>
/// <param name="hostType">The class that the property being is registered on.</param>
/// <param name="metadata">The property metadata.</param>
/// <param name="notifying">A <see cref="Notifying"/> callback.</param>
protected AvaloniaProperty (
private pr otected AvaloniaProperty (
string name ,
Type valueType ,
Type ownerType ,
Type hostType ,
AvaloniaPropertyMetadata metadata ,
Action < AvaloniaObject , bool > ? notifying = null )
{
@ -63,9 +65,9 @@ namespace Avalonia
Notifying = notifying ;
Id = s_nextId + + ;
_ metadata . Add ( owner Type, metadata ? ? throw new ArgumentNullException ( nameof ( metadata ) ) ) ;
_ metadata . Add ( host Type, metadata ? ? throw new ArgumentNullException ( nameof ( metadata ) ) ) ;
_d efaultMetadata = metadata . GenerateTypeSafeMetadata ( ) ;
_ singleMetadata = new ( owner Type, metadata ) ;
_ singleMetadata = new ( host Type, metadata ) ;
}
/// <summary>
@ -74,7 +76,7 @@ namespace Avalonia
/// <param name="source">The direct property to copy.</param>
/// <param name="ownerType">The new owner type.</param>
/// <param name="metadata">Optional overridden metadata.</param>
protected AvaloniaProperty (
private pr otected AvaloniaProperty (
AvaloniaProperty source ,
Type ownerType ,
AvaloniaPropertyMetadata ? metadata )
@ -151,7 +153,7 @@ namespace Avalonia
/// will be true before the property change notifications are sent and false afterwards. This
/// callback is intended to support Control.IsDataContextChanging.
/// </remarks>
public Action < AvaloniaObject , bool > ? Notifying { get ; }
internal Action < AvaloniaObject , bool > ? Notifying { get ; }
/// <summary>
/// Gets the integer ID that represents this property.
@ -255,6 +257,7 @@ namespace Avalonia
var result = new StyledProperty < TValue > (
name ,
typeof ( TOwner ) ,
typeof ( TOwner ) ,
metadata ,
inherits ,
validate ) ;
@ -301,6 +304,7 @@ namespace Avalonia
var result = new StyledProperty < TValue > (
name ,
typeof ( TOwner ) ,
typeof ( TOwner ) ,
metadata ,
inherits ,
validate ,
@ -338,7 +342,7 @@ namespace Avalonia
defaultBindingMode : defaultBindingMode ,
coerce : coerce ) ;
var result = new AttachedProperty < TValue > ( name , typeof ( TOwner ) , metadata , inherits , validate ) ;
var result = new AttachedProperty < TValue > ( name , typeof ( TOwner ) , typeof ( THost ) , metadata , inherits , validate ) ;
var registry = AvaloniaPropertyRegistry . Instance ;
registry . Register ( typeof ( TOwner ) , result ) ;
registry . RegisterAttached ( typeof ( THost ) , result ) ;
@ -375,7 +379,7 @@ namespace Avalonia
defaultBindingMode : defaultBindingMode ,
coerce : coerce ) ;
var result = new AttachedProperty < TValue > ( name , ownerType , metadata , inherits , validate ) ;
var result = new AttachedProperty < TValue > ( name , ownerType , typeof ( THost ) , metadata , inherits , validate ) ;
var registry = AvaloniaPropertyRegistry . Instance ;
registry . Register ( ownerType , result ) ;
registry . RegisterAttached ( typeof ( THost ) , result ) ;
@ -554,7 +558,7 @@ namespace Avalonia
/// </summary>
/// <param name="type">The type.</param>
/// <param name="metadata">The metadata.</param>
protected void OverrideMetadata ( Type type , AvaloniaPropertyMetadata metadata )
private pr otected void OverrideMetadata ( Type type , AvaloniaPropertyMetadata metadata )
{
_ = type ? ? throw new ArgumentNullException ( nameof ( type ) ) ;
_ = metadata ? ? throw new ArgumentNullException ( nameof ( metadata ) ) ;
@ -573,7 +577,7 @@ namespace Avalonia
_ singleMetadata = null ;
}
protected abstract IObservable < AvaloniaPropertyChangedEventArgs > GetChanged ( ) ;
private pr otected abstract IObservable < AvaloniaPropertyChangedEventArgs > GetChanged ( ) ;
private AvaloniaPropertyMetadata GetMetadataWithOverrides ( Type type )
{