using System; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives.PopupPositioning; using Avalonia.Interactivity; namespace ControlCatalog.Pages { public partial class FlyoutsPage : UserControl { public FlyoutsPage() { InitializeComponent(); AttachedFlyoutPanel.DoubleTapped += Afp_DoubleTapped; SetXamlTexts(); } private void Afp_DoubleTapped(object? sender, RoutedEventArgs e) { if (sender is Panel p) { FlyoutBase.ShowAttachedFlyout(p); } } private void SetXamlTexts() { var bfxt = ButtonFlyoutXamlText; bfxt.Text = ""; var mfxt = this.MenuFlyoutXamlText; mfxt.Text = ""; var afxt = this.AttachedFlyoutXamlText; afxt.Text = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n\n In DoubleTapped handler:\n" + "FlyoutBase.ShowAttachedFlyout(AttachedFlyoutPanel);"; var sfxt = this.SharedFlyoutXamlText; sfxt.Text = "Declare a flyout in Resources:\n" + "\n" + " \n" + " \n" + " \n" + " \n" + " \n\n\n" + "Then attach the flyout where you want it:\n" + "