internal void NotifyInitialized(AvaloniaObject o) { Contract.Requires <ArgumentNullException>(o != null); var type = o.GetType(); void Notify(AvaloniaProperty property, object value) { var e = new AvaloniaPropertyChangedEventArgs( o, property, AvaloniaProperty.UnsetValue, value, BindingPriority.Unset); property.NotifyInitialized(e); } if (!_initializedCache.TryGetValue(type, out var items)) { var build = new Dictionary <AvaloniaProperty, object>(); foreach (var property in GetRegistered(type)) { var value = !property.IsDirect ? ((IStyledPropertyAccessor)property).GetDefaultValue(type) : null; build.Add(property, value); } foreach (var property in GetRegisteredAttached(type)) { if (!build.ContainsKey(property)) { var value = ((IStyledPropertyAccessor)property).GetDefaultValue(type); build.Add(property, value); } } items = build.ToList(); _initializedCache.Add(type, items); } foreach (var i in items) { var value = i.Key.IsDirect ? o.GetValue(i.Key) : i.Value; Notify(i.Key, value); } }
internal override object?RouteGetBaseValue(AvaloniaObject o, BindingPriority maxPriority) { return(o.GetValue <TValue>(this)); }
/// <inheritdoc/> internal override object?RouteGetValue(AvaloniaObject o) { return(o.GetValue <TValue>(this)); }