diff --git a/src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.skia.cs b/src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.skia.cs index 7765c512e9e1edab43a75dd9b67890b96baa6f07..7e5041a543967bc8317ca9074b00ff920334a389 100644 --- a/src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.skia.cs +++ b/src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.skia.cs @@ -31,6 +31,14 @@ namespace Windows.UI.Xaml.Controls Visual.Children.InsertAtBottom(_textVisual); } +#if DEBUG + private protected override void OnLoaded() + { + base.OnLoaded(); + _textVisual.Comment = $"{Visual.Comment}#text"; + } +#endif + protected override Size MeasureOverride(Size availableSize) { var padding = Padding; diff --git a/src/Uno.UI/UI/Xaml/UIElement.crossruntime.cs b/src/Uno.UI/UI/Xaml/UIElement.crossruntime.cs index 9caf7110616b50698f49cb44bcca4d54399a21dd..e2d5c4e70536a057fc1f9f6b4b3e0cf5e25a8f99 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.crossruntime.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.crossruntime.cs @@ -68,6 +68,8 @@ namespace Windows.UI.Xaml visualTreeRoot.OnElementUnloaded(); } + partial void OnLoading(); + // Overloads for the FrameworkElement to raise the events // (Load/Unload is actually a concept of the FwElement, but it's easier to handle it directly from the UIElement) private protected virtual void OnFwEltLoading() { } @@ -85,6 +87,7 @@ namespace Windows.UI.Xaml IsLoading = true; Depth = depth; + OnLoading(); OnFwEltLoading(); // Explicit propagation of the loading even must be performed diff --git a/src/Uno.UI/UI/Xaml/UIElement.skia.cs b/src/Uno.UI/UI/Xaml/UIElement.skia.cs index e23163c24f0eee2cf865360d5b9046b5e401efb6..7033aa3bd953d9ab0bef92c4ffebb9eea96ab1ff 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.skia.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.skia.cs @@ -81,7 +81,7 @@ namespace Windows.UI.Xaml { _visual = Window.Current.Compositor.CreateShapeVisual(); #if ENABLE_CONTAINER_VISUAL_TRACKING - _visual.Comment = $"Owner: {this.GetDebugDepth():D2}-{this.GetDebugName()}"; + _visual.Comment = $"{this.GetDebugDepth():D2}-{this.GetDebugName()}"; #endif } @@ -89,6 +89,16 @@ namespace Windows.UI.Xaml } } +#if ENABLE_CONTAINER_VISUAL_TRACKING // Make sure to update the Comment to have the valid depth + partial void OnLoading() + { + if (_visual is not null) + { + _visual.Comment = $"{this.GetDebugDepth():D2}-{this.GetDebugName()}"; + } + } +#endif + internal bool ClippingIsSetByCornerRadius { get; set; } public void AddChild(UIElement child, int? index = null)