Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Core/src/Handlers/View/ViewHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Maui.Graphics;
using System.Diagnostics;
#if __IOS__ || MACCATALYST
using PlatformView = UIKit.UIView;
#elif __ANDROID__
Expand All @@ -18,6 +19,7 @@ namespace Microsoft.Maui.Handlers
/// </summary>
/// <remarks>Handlers map virtual views (.NET MAUI layer) to controls on each platform (iOS, Android, Windows, macOS, etc.), which are known as platform views.
/// Handlers are also responsible for instantiating the underlying platform view, and mapping the cross-platform control API to the platform view API. </remarks>
[DebuggerDisplay("{GetDebuggerDisplay(), nq}")]
public abstract partial class ViewHandler : ElementHandler, IViewHandler
{
/// <summary>
Expand Down Expand Up @@ -536,5 +538,20 @@ public static void MapToolTip(IViewHandler handler, IView view)
handler.ToPlatform().UpdateToolTip(tooltipContainer.ToolTip);
#endif
}

/// <summary>
/// Provides a string representation of the current object for debugging purposes.
/// </summary>
/// <remarks>
/// This method is used by the <see cref="DebuggerDisplayAttribute"/> to display
/// a concise and informative string representation of the <see cref="ViewHandler"/> instance
/// during debugging sessions.
/// </remarks>
/// <returns>A string containing the type name and key properties of the object.</returns>
private protected virtual string GetDebuggerDisplay()
{
var debugText = DebuggerDisplayHelpers.GetDebugText(nameof(VirtualView), VirtualView, nameof(PlatformView), PlatformView);
return $"{GetType().FullName}: {debugText}";
}
}
}
Loading