Browse Source
Make ValueCache as abstract props.
Add setters to Row/ColumnDefinitions.
pull/2563/head
Jumar Macato
7 years ago
No known key found for this signature in database
GPG Key ID: B19884DAC3A5BF3F
4 changed files with
22 additions and
31 deletions
-
src/Avalonia.Controls/ColumnDefinition.cs
-
src/Avalonia.Controls/DefinitionBase.cs
-
src/Avalonia.Controls/Grid.cs
-
src/Avalonia.Controls/RowDefinition.cs
|
|
|
@ -87,5 +87,9 @@ namespace Avalonia.Controls |
|
|
|
get { return GetValue(WidthProperty); } |
|
|
|
set { SetValue(WidthProperty, value); } |
|
|
|
} |
|
|
|
|
|
|
|
internal override GridLength UserSizeValueCache => this.Width; |
|
|
|
internal override double UserMinSizeValueCache => this.MinWidth; |
|
|
|
internal override double UserMaxSizeValueCache => this.MaxWidth; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -410,45 +410,18 @@ namespace Avalonia.Controls |
|
|
|
/// <summary>
|
|
|
|
/// Internal helper to access up-to-date UserSize property value.
|
|
|
|
/// </summary>
|
|
|
|
internal GridLength UserSizeValueCache |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
return (GridLength) GetValue( |
|
|
|
_isColumnDefinition ? |
|
|
|
ColumnDefinition.WidthProperty : |
|
|
|
RowDefinition.HeightProperty); |
|
|
|
} |
|
|
|
} |
|
|
|
internal abstract GridLength UserSizeValueCache { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Internal helper to access up-to-date UserMinSize property value.
|
|
|
|
/// </summary>
|
|
|
|
internal double UserMinSizeValueCache |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
return (double) GetValue( |
|
|
|
_isColumnDefinition ? |
|
|
|
ColumnDefinition.MinWidthProperty : |
|
|
|
RowDefinition.MinHeightProperty); |
|
|
|
} |
|
|
|
} |
|
|
|
internal abstract double UserMinSizeValueCache { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Internal helper to access up-to-date UserMaxSize property value.
|
|
|
|
/// </summary>
|
|
|
|
internal double UserMaxSizeValueCache |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
return (double) GetValue( |
|
|
|
_isColumnDefinition ? |
|
|
|
ColumnDefinition.MaxWidthProperty : |
|
|
|
RowDefinition.MaxHeightProperty); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal abstract double UserMaxSizeValueCache { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Protected. Returns <c>true</c> if this DefinitionBase instance is in parent's logical tree.
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
@ -216,6 +216,11 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
return (_data.ColumnDefinitions); |
|
|
|
} |
|
|
|
set |
|
|
|
{ |
|
|
|
if (_data == null) { _data = new ExtendedData(); } |
|
|
|
_data.ColumnDefinitions = value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -230,6 +235,11 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
return (_data.RowDefinitions); |
|
|
|
} |
|
|
|
set |
|
|
|
{ |
|
|
|
if (_data == null) { _data = new ExtendedData(); } |
|
|
|
_data.RowDefinitions = value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//------------------------------------------------------
|
|
|
|
|
|
|
|
@ -87,5 +87,9 @@ namespace Avalonia.Controls |
|
|
|
get { return GetValue(HeightProperty); } |
|
|
|
set { SetValue(HeightProperty, value); } |
|
|
|
} |
|
|
|
|
|
|
|
internal override GridLength UserSizeValueCache => this.Height; |
|
|
|
internal override double UserMinSizeValueCache => this.MinHeight; |
|
|
|
internal override double UserMaxSizeValueCache => this.MaxHeight; |
|
|
|
} |
|
|
|
} |