From be6784d6e8b8565487198c64ef892a9ea97fa19b Mon Sep 17 00:00:00 2001 From: Luis von der Eltz Date: Thu, 10 Feb 2022 12:31:07 +0100 Subject: [PATCH] Enable diagnostics for button flyouts --- .../Diagnostics/ViewModels/VisualTreeNode.cs | 6 +++++- .../Diagnostics/Views/MainWindow.xaml.cs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/VisualTreeNode.cs b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/VisualTreeNode.cs index 819a203d62d..4a5cb0fd3f9 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/VisualTreeNode.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/VisualTreeNode.cs @@ -84,7 +84,8 @@ public override void Dispose() c.GetObservable(Control.ContextMenuProperty), c.GetObservable(FlyoutBase.AttachedFlyoutProperty), c.GetObservable(ToolTipDiagnostics.ToolTipProperty), - (ContextFlyout, ContextMenu, AttachedFlyout, ToolTip) => + c.GetObservable(Button.FlyoutProperty), + (ContextFlyout, ContextMenu, AttachedFlyout, ToolTip, ButtonFlyout) => { if (ContextMenu != null) //Note: ContextMenus are special since all the items are added as visual children. @@ -100,6 +101,9 @@ public override void Dispose() if (ToolTip != null) return GetPopupHostObservable(ToolTip, "ToolTip"); + if (ButtonFlyout != null) + return GetPopupHostObservable(ButtonFlyout, "Flyout"); + return Observable.Return(null); }) .Switch(), diff --git a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs index 7a894d96fbb..a3cff7f3d3d 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs @@ -147,6 +147,7 @@ void ProcessProperty(IControl control, AvaloniaProperty property) ProcessProperty(control, ContextMenuProperty); ProcessProperty(control, FlyoutBase.AttachedFlyoutProperty); ProcessProperty(control, ToolTipDiagnostics.ToolTipProperty); + ProcessProperty(control, Button.FlyoutProperty); } return popupRoots;