Browse Source

Add inheritance parent to DefBase.

Jumar Macato 6 years ago
parent
commit
7e16a9032a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Avalonia.Controls/DefinitionBase.cs

+ 3 - 3
src/Avalonia.Controls/DefinitionBase.cs

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