|
|
@@ -1,7 +1,6 @@
|
|
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
|
|
|
-using System.Collections.Specialized;
|
|
|
using System.Linq;
|
|
|
using Avalonia.Collections;
|
|
|
|
|
|
@@ -10,7 +9,7 @@ namespace Avalonia.Controls
|
|
|
/// <summary>
|
|
|
/// A collection of <see cref="RowDefinition"/>s.
|
|
|
/// </summary>
|
|
|
- public class RowDefinitions : AvaloniaList<RowDefinition>
|
|
|
+ public class RowDefinitions : DefinitionList<RowDefinition>
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="RowDefinitions"/> class.
|
|
|
@@ -22,31 +21,6 @@ namespace Avalonia.Controls
|
|
|
this.TrackItemPropertyChanged(delegate { IsDirty = true; });
|
|
|
}
|
|
|
|
|
|
- internal bool IsDirty { get; set; } = true;
|
|
|
- internal Grid Parent { get; set; }
|
|
|
-
|
|
|
- private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
|
|
- {
|
|
|
- foreach (var nI in this.Select((d, i) => (d, i)))
|
|
|
- nI.d._parentIndex = nI.i;
|
|
|
-
|
|
|
- foreach (var nD in e.NewItems?.Cast<DefinitionBase>()
|
|
|
- ?? Enumerable.Empty<DefinitionBase>())
|
|
|
- {
|
|
|
- nD.Parent = this.Parent;
|
|
|
- nD.OnEnterParentTree();
|
|
|
- }
|
|
|
-
|
|
|
- foreach (var oD in e.OldItems?.Cast<DefinitionBase>()
|
|
|
- ?? Enumerable.Empty<DefinitionBase>())
|
|
|
- {
|
|
|
- oD.Parent = null;
|
|
|
- oD.OnExitParentTree();
|
|
|
- }
|
|
|
-
|
|
|
- IsDirty = true;
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="RowDefinitions"/> class.
|
|
|
/// </summary>
|