Browse Source

Add inheritance parent to DefBase.

pull/2563/head
Jumar Macato 7 years ago
parent
commit
7e16a9032a
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 6
      src/Avalonia.Controls/DefinitionBase.cs

6
src/Avalonia.Controls/DefinitionBase.cs

@ -68,6 +68,7 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
internal void OnEnterParentTree() internal void OnEnterParentTree()
{ {
this.InheritanceParent = Parent;
if (_sharedState == null) if (_sharedState == null)
{ {
// start with getting SharedSizeGroup value. // start with getting SharedSizeGroup value.
@ -87,7 +88,7 @@ namespace Avalonia.Controls
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e) protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
{ {
if(e.Property.PropertyType == typeof(GridLength) if (e.Property.PropertyType == typeof(GridLength)
|| e.Property.PropertyType == typeof(double)) || e.Property.PropertyType == typeof(double))
OnUserSizePropertyChanged(e); OnUserSizePropertyChanged(e);
@ -165,7 +166,6 @@ namespace Avalonia.Controls
} }
} }
} }
/// <summary> /// <summary>
/// <see cref="AvaloniaProperty.ValidateValueCallback"/> /// <see cref="AvaloniaProperty.ValidateValueCallback"/>
/// </summary> /// </summary>
@ -939,7 +939,7 @@ namespace Avalonia.Controls
static DefinitionBase() static DefinitionBase()
{ {
SharedSizeGroupProperty.Changed.AddClassHandler<DefinitionBase>(OnSharedSizeGroupPropertyChanged); SharedSizeGroupProperty.Changed.AddClassHandler<DefinitionBase>(OnSharedSizeGroupPropertyChanged);
PrivateSharedSizeScopeProperty.Changed.AddClassHandler<DefinitionBase>(OnPrivateSharedSizeScopePropertyChanged); PrivateSharedSizeScopeProperty.Changed.AddClassHandler<Control>(OnPrivateSharedSizeScopePropertyChanged);
} }
#endregion Properties #endregion Properties

Loading…
Cancel
Save