|
@@ -20,7 +20,6 @@ namespace Avalonia
|
|
|
public static readonly object UnsetValue = new UnsetValueType();
|
|
public static readonly object UnsetValue = new UnsetValueType();
|
|
|
|
|
|
|
|
private static int s_nextId;
|
|
private static int s_nextId;
|
|
|
- private readonly Subject<AvaloniaPropertyChangedEventArgs> _initialized;
|
|
|
|
|
private readonly Subject<AvaloniaPropertyChangedEventArgs> _changed;
|
|
private readonly Subject<AvaloniaPropertyChangedEventArgs> _changed;
|
|
|
private readonly PropertyMetadata _defaultMetadata;
|
|
private readonly PropertyMetadata _defaultMetadata;
|
|
|
private readonly Dictionary<Type, PropertyMetadata> _metadata;
|
|
private readonly Dictionary<Type, PropertyMetadata> _metadata;
|
|
@@ -53,7 +52,6 @@ namespace Avalonia
|
|
|
throw new ArgumentException("'name' may not contain periods.");
|
|
throw new ArgumentException("'name' may not contain periods.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- _initialized = new Subject<AvaloniaPropertyChangedEventArgs>();
|
|
|
|
|
_changed = new Subject<AvaloniaPropertyChangedEventArgs>();
|
|
_changed = new Subject<AvaloniaPropertyChangedEventArgs>();
|
|
|
_metadata = new Dictionary<Type, PropertyMetadata>();
|
|
_metadata = new Dictionary<Type, PropertyMetadata>();
|
|
|
|
|
|
|
@@ -81,7 +79,6 @@ namespace Avalonia
|
|
|
Contract.Requires<ArgumentNullException>(source != null);
|
|
Contract.Requires<ArgumentNullException>(source != null);
|
|
|
Contract.Requires<ArgumentNullException>(ownerType != null);
|
|
Contract.Requires<ArgumentNullException>(ownerType != null);
|
|
|
|
|
|
|
|
- _initialized = source._initialized;
|
|
|
|
|
_changed = source._changed;
|
|
_changed = source._changed;
|
|
|
_metadata = new Dictionary<Type, PropertyMetadata>();
|
|
_metadata = new Dictionary<Type, PropertyMetadata>();
|
|
|
|
|
|
|
@@ -136,22 +133,6 @@ namespace Avalonia
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
public virtual bool IsReadOnly => false;
|
|
public virtual bool IsReadOnly => false;
|
|
|
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Gets an observable that is fired when this property is initialized on a
|
|
|
|
|
- /// new <see cref="AvaloniaObject"/> instance.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <remarks>
|
|
|
|
|
- /// This observable is fired each time a new <see cref="AvaloniaObject"/> is constructed
|
|
|
|
|
- /// for all properties registered on the object's type. The default value of the property
|
|
|
|
|
- /// for the object is passed in the args' NewValue (OldValue will always be
|
|
|
|
|
- /// <see cref="UnsetValue"/>.
|
|
|
|
|
- /// </remarks>
|
|
|
|
|
- /// <value>
|
|
|
|
|
- /// An observable that is fired when this property is initialized on a new
|
|
|
|
|
- /// <see cref="AvaloniaObject"/> instance.
|
|
|
|
|
- /// </value>
|
|
|
|
|
- public IObservable<AvaloniaPropertyChangedEventArgs> Initialized => _initialized;
|
|
|
|
|
-
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Gets an observable that is fired when this property changes on any
|
|
/// Gets an observable that is fired when this property changes on any
|
|
|
/// <see cref="AvaloniaObject"/> instance.
|
|
/// <see cref="AvaloniaObject"/> instance.
|
|
@@ -488,26 +469,6 @@ namespace Avalonia
|
|
|
return Name;
|
|
return Name;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// True if <see cref="Initialized"/> has any observers.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- internal bool HasNotifyInitializedObservers => _initialized.HasObservers;
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Notifies the <see cref="Initialized"/> observable.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <param name="o">The object being initialized.</param>
|
|
|
|
|
- internal abstract void NotifyInitialized(IAvaloniaObject o);
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Notifies the <see cref="Initialized"/> observable.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <param name="e">The observable arguments.</param>
|
|
|
|
|
- internal void NotifyInitialized(AvaloniaPropertyChangedEventArgs e)
|
|
|
|
|
- {
|
|
|
|
|
- _initialized.OnNext(e);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Notifies the <see cref="Changed"/> observable.
|
|
/// Notifies the <see cref="Changed"/> observable.
|
|
|
/// </summary>
|
|
/// </summary>
|