[NUI] add Set/GetAttachedValue method (#2007)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Layouting / LayoutGroup.cs
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Diagnostics;
21 using Tizen.NUI.BaseComponents;
22 using System.Linq;
23 using Tizen.NUI.Binding.Internals;
24 using static Tizen.NUI.Binding.BindableObject;
25
26 namespace Tizen.NUI
27 {
28     /// <summary>
29     /// [Draft] LayoutGroup class providing container functionality.
30     /// </summary>
31     public class LayoutGroup : LayoutItem, ILayoutParent
32     {
33         /// <summary>
34         /// [Draft] List of child layouts in this container.
35         /// </summary>
36         /// <since_tizen> 6 </since_tizen>
37         protected List<LayoutItem> LayoutChildren{ get;} // Children of this LayoutGroup
38
39         /// <summary>
40         /// [Draft] Constructor
41         /// </summary>
42         /// <since_tizen> 6 </since_tizen>
43         public LayoutGroup()
44         {
45             LayoutChildren = new List<LayoutItem>();
46         }
47
48         /// <summary>
49         /// From ILayoutParent.<br />
50         /// </summary>
51         /// <since_tizen> 6 </since_tizen>
52         /// <param name="childLayout">LayoutItem to add to the layout group.</param>
53         public virtual void Add(LayoutItem childLayout)
54         {
55             LayoutChildren.Add(childLayout);
56             childLayout.SetParent(this);
57             // Child added to use a Add transition.
58             childLayout.ConditionForAnimation = ConditionForAnimation | TransitionCondition.Add;
59             // Child's parent sets all other children not being added to a ChangeOnAdd transition.
60             SetConditionsForAnimationOnLayoutGroup(TransitionCondition.ChangeOnAdd);
61             OnChildAdd(childLayout);
62             RequestLayout();
63         }
64
65         /// <summary>
66         /// Remove all layout children.<br />
67         /// </summary>
68         /// <since_tizen> 6 </since_tizen>
69         public void RemoveAll()
70         {
71             foreach( LayoutItem childLayout in LayoutChildren )
72             {
73                 childLayout.ConditionForAnimation = ConditionForAnimation | TransitionCondition.Remove;
74                 childLayout.Owner = null;
75             }
76             LayoutChildren.Clear();
77             // todo ensure child LayoutItems are still not parented to this group.
78             RequestLayout();
79         }
80
81         /// <summary>
82         /// From ILayoutParent
83         /// </summary>
84         /// <param name="layoutItem">LayoutItem to remove from the layout group.</param>
85         /// <since_tizen> 6 </since_tizen>
86         public virtual void Remove(LayoutItem layoutItem)
87         {
88             bool childRemoved = false;
89             foreach( LayoutItem childLayout in LayoutChildren.ToList() )
90             {
91                 if( childLayout == layoutItem )
92                 {
93                     childLayout.ClearReplaceFlag();
94                     LayoutChildren.Remove(childLayout);
95
96                     if (LayoutWithTransition)
97                     {
98                         if (!childLayout.IsReplaceFlag())
99                         {
100                             NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
101                         }
102
103                         childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove;
104                         // Add LayoutItem to the transition stack so can animate it out.
105                         NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
106                     }
107
108                     // Reset condition for animation ready for next transition when required.
109                     // SetFrame usually would do this but this LayoutItem is being removed.
110                     childLayout.ConditionForAnimation = TransitionCondition.Unspecified;
111                     childRemoved = true;
112
113                     break;
114                 }
115             }
116
117             if (childRemoved)
118             {
119                 // If child removed then set all siblings not being added to a ChangeOnRemove transition.
120                 SetConditionsForAnimationOnLayoutGroup(TransitionCondition.ChangeOnRemove);
121             }
122
123             RequestLayout();
124         }
125
126
127         /// <summary>
128         /// Sets the sibling order of the layout item so the layout can be defined within the same parent.
129         /// </summary>
130         /// <param name="order">the sibling order of the layout item</param>
131         /// <since_tizen> 6 </since_tizen>
132         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
133         [EditorBrowsable(EditorBrowsableState.Never)]
134         public void ChangeLayoutSiblingOrder(int order)
135         {
136             if(Owner != null && Owner.Parent != null)
137             {
138                 LayoutGroup parent = Owner.Parent.Layout as LayoutGroup;
139
140                 if(parent != null && parent.LayoutChildren.Count>order)
141                 {
142                     parent.LayoutChildren.Remove(this);
143                     parent.LayoutChildren.Insert(order,this);
144                 }
145             }
146
147             RequestLayout();
148         }
149
150         // Attaches to View ChildAdded signal so called when a View is added to a view.
151         private void AddChildToLayoutGroup(View child)
152         {
153             // Only give children a layout if their parent is an explicit container or a pure View.
154             // Pure View meaning not derived from a View, e.g a Legacy container.
155             // layoutSet flag is true when the View became a layout using the set Layout API opposed to automatically due to it's parent.
156             // First time the set Layout API is used by any View the Window no longer has layoutingDisabled.
157
158             // If child already has a Layout then don't change it.
159             if (! View.layoutingDisabled && (null == child.Layout))
160             {
161                 // Only wrap View with a Layout if a child a pure View or Layout explicitly set on this Layout
162                 if ((true == Owner.layoutSet || GetType() == typeof(View)))
163                 {
164                     // If child of this layout is a pure View then assign it a LayoutGroup
165                     // If the child is derived from a View then it may be a legacy or existing container hence will do layouting itself.
166                     child.Layout = new AbsoluteLayout();
167                 }
168             }
169             else
170             {
171                 // Add child layout to this LayoutGroup (Setting parent in the process)
172                 if(child.Layout != null)
173                 {
174                     Add(child.Layout);
175                 }
176             }
177             // Parent transitions are not attached to children.
178         }
179
180         /// <summary>
181         /// If the child has a layout then it is removed from the parent layout.
182         /// </summary>
183         /// <param name="child">Child View to remove.</param>
184         internal void RemoveChildFromLayoutGroup(View child)
185         {
186             Debug.Assert(child.Layout !=null);
187             Remove(child.Layout);
188         }
189
190         /// <summary>
191         /// Set all children in a LayoutGroup to the supplied condition.
192         /// Children with Add or Remove conditions should not be changed.
193         /// </summary>
194         private void SetConditionsForAnimationOnLayoutGroup( TransitionCondition conditionToSet)
195         {
196             foreach( LayoutItem childLayout in LayoutChildren )
197             {
198                 switch( conditionToSet )
199                 {
200                 case TransitionCondition.ChangeOnAdd :
201                 {
202                     // If other children also being added (TransitionCondition.Add) then do not change their
203                     // conditions, Continue to use their Add transitions.
204                     if (childLayout.ConditionForAnimation.HasFlag(TransitionCondition.Add))
205                     {
206                         break;  // Child being Added so don't update it's condition
207                     }
208                     else
209                     {
210                         // Set siblings for the child being added to use the ChangeOnAdd transition.
211                         childLayout.ConditionForAnimation = TransitionCondition.ChangeOnAdd;
212                     }
213                     break;
214                 }
215                 case TransitionCondition.ChangeOnRemove :
216                 {
217                     if (childLayout.ConditionForAnimation.HasFlag(TransitionCondition.Remove))
218                     {
219                         break; // Child being Removed so don't update it's condition
220                     }
221                     else
222                     {
223                         childLayout.ConditionForAnimation = TransitionCondition.ChangeOnRemove;
224                     }
225                     break;
226                 }
227                 case TransitionCondition.LayoutChanged :
228                 {
229                     childLayout.ConditionForAnimation = TransitionCondition.LayoutChanged;
230                     break;
231                 }
232                 }
233             }
234
235         }
236
237         /// <summary>
238         /// Callback for View.ChildAdded event
239         /// </summary>
240         /// <param name="sender">The object triggering the event.</param>
241         /// <param name="childAddedEvent">Arguments from the event.</param>
242         void OnChildAddedToOwner(object sender, View.ChildAddedEventArgs childAddedEvent)
243         {
244             AddChildToLayoutGroup(childAddedEvent.Added);
245         }
246
247         /// <summary>
248         /// Callback for View.ChildRemoved event
249         /// </summary>
250         /// <param name="sender">The object triggering the event.</param>
251         /// <param name="childRemovedEvent">Arguments from the event.</param>
252         void OnChildRemovedFromOwner(object sender, View.ChildRemovedEventArgs childRemovedEvent)
253         {
254             RemoveChildFromLayoutGroup(childRemovedEvent.Removed);
255         }
256
257         /// <summary>
258         /// Calculate the right measure spec for this child.
259         /// Does the hard part of MeasureChildren: figuring out the MeasureSpec to
260         /// pass to a particular child. This method figures out the right MeasureSpec
261         /// for one dimension (height or width) of one child view.<br />
262         /// </summary>
263         /// <param name="parentMeasureSpec">The requirements for this view. MeasureSpecification.</param>
264         /// <param name="padding">The padding of this view for the current dimension and margins, if applicable. LayoutLength.</param>
265         /// <param name="childDimension"> How big the child wants to be in the current dimension. LayoutLength.</param>
266         /// <returns>a MeasureSpec for the child.</returns>
267         public static MeasureSpecification GetChildMeasureSpecification(MeasureSpecification parentMeasureSpec, LayoutLength padding, LayoutLength childDimension)
268         {
269             MeasureSpecification.ModeType specMode = parentMeasureSpec.Mode;
270             MeasureSpecification.ModeType resultMode = MeasureSpecification.ModeType.Unspecified;
271
272             // Child only can use parent's size without parent's padding and own margin.
273             LayoutLength resultSize = new LayoutLength(Math.Max( 0.0f, (parentMeasureSpec.Size - padding).AsDecimal()));
274             switch( specMode )
275             {
276                 // Parent has imposed an exact size on us
277                 case MeasureSpecification.ModeType.Exactly:
278                 {
279                     if ((int)childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
280                     {
281                         resultMode = MeasureSpecification.ModeType.Exactly;
282                     }
283                     else if ((int)childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
284                     {
285                         resultMode = MeasureSpecification.ModeType.AtMost;
286                     }
287                     else
288                     {
289                         resultSize = childDimension;
290                         resultMode = MeasureSpecification.ModeType.Exactly;
291                     }
292
293                     break;
294                 }
295
296                 // Parent has imposed a maximum size on us
297                 case MeasureSpecification.ModeType.AtMost:
298                 {
299                     if (childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
300                     {
301                         // Crashed. Cannot calculate. 
302
303                         // Child wants to be our size, but our size is not fixed.
304                         // Constrain child to not be bigger than us.
305                         resultMode = MeasureSpecification.ModeType.AtMost;
306                     }
307                     else if (childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
308                     {
309                         // Child wants to determine its own size. It can't be
310                         // bigger than us.
311
312                         // Don't need parent's size. Size of this child will be determined by its children.
313                         resultMode = MeasureSpecification.ModeType.AtMost;
314                     }
315                     else
316                     {
317                         // Child wants a specific size... so be it
318                         resultSize = childDimension;
319                         resultMode = MeasureSpecification.ModeType.Exactly;
320                     }
321
322                     break;
323                 }
324
325                 // Parent asked to see how big we want to be
326                 case MeasureSpecification.ModeType.Unspecified:
327                 {
328                     if ((childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent))
329                     {
330                         // Child wants to be our size... find out how big it should be
331
332                         // There is no one who has exact size in parent hierarchy.
333                         // Cannot calculate.
334                         resultMode = MeasureSpecification.ModeType.Unspecified;
335                     }
336                     else if (childDimension.AsRoundedValue() == (LayoutParamPolicies.WrapContent))
337                     {
338                         // Child wants to determine its own size.... find out how big
339                         // it should be
340                         resultMode = MeasureSpecification.ModeType.Unspecified;
341                     }
342                     else
343                     {
344                         // Child wants a specific size... let him have it
345                         resultSize = childDimension;
346                         resultMode = MeasureSpecification.ModeType.Exactly;
347                     }
348                     break;
349                 }
350             } // switch
351
352             return new MeasureSpecification( resultSize, resultMode );
353         }
354
355         /// <summary>
356         /// Measure the layout and its content to determine the measured width and the measured height.<br />
357         /// If this method is overridden, it is the subclass's responsibility to make
358         /// sure the measured height and width are at least the layout's minimum height
359         /// and width. <br />
360         /// </summary>
361         /// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
362         /// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
363         /// <since_tizen> 6 </since_tizen>
364         protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
365         {
366             LayoutLength measuredWidth = new LayoutLength(0.0f);
367             LayoutLength measuredHeight = new LayoutLength(0.0f);
368
369             // Layout takes size of largest child width and largest child height dimensions
370             foreach( LayoutItem childLayout in LayoutChildren )
371             {
372                 if( childLayout != null )
373                 {
374                     MeasureChildWithMargins( childLayout, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0) );
375                     LayoutLength childWidth = new LayoutLength(childLayout.MeasuredWidth.Size);
376                     LayoutLength childHeight = new LayoutLength( childLayout.MeasuredHeight.Size);
377
378                     Extents childMargin = childLayout.Margin;
379                     measuredWidth = new LayoutLength(Math.Max( measuredWidth.AsDecimal(), childWidth.AsDecimal() + childMargin.Start + childMargin.End));
380                     measuredHeight = new LayoutLength(Math.Max( measuredHeight.AsDecimal(), childHeight.AsDecimal() + childMargin.Top + childMargin.Bottom));
381                 }
382             }
383
384             if( 0 == LayoutChildren.Count )
385             {
386                 // Must be a leaf as has no children
387                 measuredWidth = GetDefaultSize( SuggestedMinimumWidth, widthMeasureSpec );
388                 measuredHeight = GetDefaultSize( SuggestedMinimumHeight, heightMeasureSpec );
389             }
390
391             SetMeasuredDimensions( new MeasuredSize( measuredWidth, MeasuredSize.StateType.MeasuredSizeOK ),
392                                    new MeasuredSize( measuredHeight, MeasuredSize.StateType.MeasuredSizeOK ) );
393         }
394
395         /// <summary>
396         /// Called from Layout() when this layout should assign a size and position to each of its children.<br />
397         /// Derived classes with children should override this method and call Layout() on each of their children.<br />
398         /// </summary>
399         /// <param name="changed">This is a new size or position for this layout.</param>
400         /// <param name="left">Left position, relative to parent.</param>
401         /// <param name="top"> Top position, relative to parent.</param>
402         /// <param name="right">Right position, relative to parent.</param>
403         /// <param name="bottom">Bottom position, relative to parent.</param>
404         /// <since_tizen> 6 </since_tizen>
405         protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
406         {
407             foreach( LayoutItem childLayout in LayoutChildren )
408             {
409                 if( childLayout !=null )
410                 {
411                     // Use position if explicitly set to child otherwise will be top left.
412                     var childLeft = new LayoutLength( childLayout.Owner.Position2D.X );
413                     var childTop = new LayoutLength( childLayout.Owner.Position2D.Y );
414
415                     View owner = Owner;
416
417                     if ( owner )
418                     {
419                         // Margin and Padding only supported when child anchor point is TOP_LEFT.
420                         if ( owner.PivotPoint == PivotPoint.TopLeft || ( owner.PositionUsesPivotPoint == false ) )
421                         {
422                             childLeft = childLeft + owner.Padding.Start + childLayout.Margin.Start;
423                             childTop = childTop + owner.Padding.Top + childLayout.Margin.Top;
424                         }
425                     }
426                     childLayout.Layout( childLeft, childTop, childLeft + childLayout.MeasuredWidth.Size, childTop + childLayout.MeasuredHeight.Size );
427                 }
428             }
429         }
430
431         /// <summary>
432         /// Overridden method called when the layout is attached to an owner.<br />
433         /// </summary>
434         /// <since_tizen> 6 </since_tizen>
435         protected override void OnAttachedToOwner()
436         {
437             // Layout takes ownership of it's owner's children.
438             foreach (View view in Owner.Children)
439             {
440                 AddChildToLayoutGroup(view);
441             }
442
443             // Connect to owner ChildAdded signal.
444             Owner.ChildAdded += OnChildAddedToOwner;
445
446             // Removing Child from the owners View will directly call the LayoutGroup removal API.
447         }
448
449         /// <summary>
450         /// Virtual method to allow derived classes to remove any children before it is removed from
451         /// its parent.
452         /// </summary>
453         [EditorBrowsable(EditorBrowsableState.Never)]
454         protected override void OnUnparent()
455         {
456             // Disconnect to owner ChildAdded signal.
457             Owner.ChildAdded -= OnChildAddedToOwner;
458         }
459
460         // Virtual Methods that can be overridden by derived classes.
461
462         /// <summary>
463         /// Callback when child is added to container.<br />
464         /// Derived classes can use this to set their own child properties on the child layout's owner.<br />
465         /// </summary>
466         /// <param name="child">The Layout child.</param>
467         /// <since_tizen> 6 </since_tizen>
468         protected virtual void OnChildAdd(LayoutItem child)
469         {
470         }
471
472         /// <summary>
473         /// Callback when child is removed from container.<br />
474         /// </summary>
475         /// <param name="child">The Layout child.</param>
476         /// <since_tizen> 6 </since_tizen>
477         protected virtual void OnChildRemove(LayoutItem child)
478         {
479         }
480
481         /// <summary>
482         /// Ask all of the children of this view to measure themselves, taking into
483         /// account both the MeasureSpec requirements for this view and its padding.<br />
484         /// The heavy lifting is done in GetChildMeasureSpec.<br />
485         /// </summary>
486         /// <param name="widthMeasureSpec">The width requirements for this view.</param>
487         /// <param name="heightMeasureSpec">The height requirements for this view.</param>
488         /// <since_tizen> 6 </since_tizen>
489         protected virtual void MeasureChildren(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
490         {
491             foreach( LayoutItem childLayout in LayoutChildren )
492             {
493                 MeasureChildWithMargins(childLayout, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0));
494             }
495         }
496
497         /// <summary>
498         /// Ask one of the children of this view to measure itself, taking into
499         /// account both the MeasureSpec requirements for this view and its padding.<br />
500         /// The heavy lifting is done in GetChildMeasureSpecification.<br />
501         /// </summary>
502         /// <param name="child">The child to measure.</param>
503         /// <param name="parentWidthMeasureSpec">The width requirements for this view.</param>
504         /// <param name="parentHeightMeasureSpec">The height requirements for this view.</param>
505         /// <since_tizen> 6 </since_tizen>
506         protected virtual void MeasureChild(LayoutItem child, MeasureSpecification parentWidthMeasureSpec, MeasureSpecification parentHeightMeasureSpec)
507         {
508             View childOwner = child.Owner;
509
510             MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(
511                         new MeasureSpecification(new LayoutLength(parentWidthMeasureSpec.Size), parentWidthMeasureSpec.Mode),
512                         new LayoutLength(Padding.Start + Padding.End ),
513                         new LayoutLength(childOwner.WidthSpecification) );
514
515             MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(
516                         new MeasureSpecification(new LayoutLength(parentHeightMeasureSpec.Size), parentHeightMeasureSpec.Mode),
517                         new LayoutLength(Padding.Top + Padding.Bottom),
518                         new LayoutLength(childOwner.HeightSpecification));
519
520             child.Measure(childWidthMeasureSpec, childHeightMeasureSpec);
521         }
522
523         /// <summary>
524         /// Ask one of the children of this view to measure itself, taking into
525         /// account both the MeasureSpec requirements for this view and its padding.<br />
526         /// and margins. The heavy lifting is done in GetChildMeasureSpecification.<br />
527         /// </summary>
528         /// <param name="child">The child to measure.</param>
529         /// <param name="parentWidthMeasureSpec">The width requirements for this view.</param>
530         /// <param name="widthUsed">Extra space that has been used up by the parent horizontally (possibly by other children of the parent).</param>
531         /// <param name="parentHeightMeasureSpec">The height requirements for this view.</param>
532         /// <param name="heightUsed">Extra space that has been used up by the parent vertically (possibly by other children of the parent).</param>
533         /// <since_tizen> 6 </since_tizen>
534         protected virtual void MeasureChildWithMargins(LayoutItem child, MeasureSpecification parentWidthMeasureSpec, LayoutLength widthUsed, MeasureSpecification parentHeightMeasureSpec, LayoutLength heightUsed)
535         {
536             View childOwner = child.Owner;
537
538
539             MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(
540                         new MeasureSpecification(
541                             new LayoutLength(parentWidthMeasureSpec.Size + widthUsed - (childOwner.Margin.Start + childOwner.Margin.End)),
542                             parentWidthMeasureSpec.Mode),
543                         new LayoutLength(Padding.Start + Padding.End ),
544                         new LayoutLength(childOwner.WidthSpecification) );
545
546             MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(
547                         new MeasureSpecification(
548                             new LayoutLength(parentHeightMeasureSpec.Size + heightUsed - (childOwner.Margin.Top + childOwner.Margin.Bottom)),
549                             parentHeightMeasureSpec.Mode),
550                         new LayoutLength(Padding.Top + Padding.Bottom),
551                         new LayoutLength(childOwner.HeightSpecification));
552             child.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
553
554         }
555
556         /// <summary>
557         /// Gets the value that is contained in the attached BindableProperty.
558         /// </summary>
559         /// <typeparam name="T">The return type of property</typeparam>
560         /// <param name="bindable">The bindable object.</param>
561         /// <param name="property">The BindableProperty for which to get the value.</param>
562         /// <returns>The value that is contained in the attached BindableProperty.</returns>
563         [EditorBrowsable(EditorBrowsableState.Never)]
564         public static T GetAttachedValue<T>(Binding.BindableObject bindable, Binding.BindableProperty property)
565         {
566             if (bindable == null)
567                 throw new ArgumentNullException(nameof(bindable));
568
569             return (T)bindable.GetValue(property);
570         }
571
572         /// <summary>
573         /// Sets the value of the attached property.
574         /// </summary>
575         /// <param name="bindable">The bindable object.</param>
576         /// <param name="property">The BindableProperty on which to assign a value.</param>
577         /// <param name="value">The value to set.</param>
578         [EditorBrowsable(EditorBrowsableState.Never)]
579         public static void SetAttachedValue(Binding.BindableObject bindable, Binding.BindableProperty property, object value)
580         {
581             if (bindable == null)
582                 throw new ArgumentNullException(nameof(bindable));
583
584             bindable.SetValueCore(property, value, SetValueFlags.None, SetValuePrivateFlags.ManuallySet, false);
585         }
586         internal static void OnChildPropertyChanged(Binding.BindableObject bindable, object oldValue, object newValue)
587         {
588             View view = bindable as View;
589             view?.Layout?.RequestLayout();
590         }
591     }
592 }