Browse Source

Eliminate OnUserSizePropertyChanged

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

34
src/Avalonia.Controls/DefinitionBase.cs

@ -52,15 +52,6 @@ namespace Avalonia.Controls
} }
} }
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
if (e.Property.PropertyType == typeof(GridLength)
|| e.Property.PropertyType == typeof(double))
OnUserSizePropertyChanged(e);
base.OnPropertyChanged(e);
}
/// <summary> /// <summary>
/// Callback to notify about exitting model tree. /// Callback to notify about exitting model tree.
/// </summary> /// </summary>
@ -105,31 +96,6 @@ namespace Avalonia.Controls
_minSize = minSize; _minSize = minSize;
} }
/// <remarks>
/// This method needs to be internal to be accessable from derived classes.
/// </remarks>
internal void OnUserSizePropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
if (Parent != null)
{
if (_sharedState != null)
{
_sharedState?.Invalidate();
}
else
{
if (((GridLength)e.OldValue).GridUnitType != ((GridLength)e.NewValue).GridUnitType)
{
Parent.Invalidate();
}
else
{
Parent.InvalidateMeasure();
}
}
}
}
/// <remarks> /// <remarks>
/// This method reflects Grid.SharedScopeProperty state by setting / clearing /// This method reflects Grid.SharedScopeProperty state by setting / clearing
/// dynamic property PrivateSharedSizeScopeProperty. Value of PrivateSharedSizeScopeProperty /// dynamic property PrivateSharedSizeScopeProperty. Value of PrivateSharedSizeScopeProperty

Loading…
Cancel
Save