A custom flyout control that provides additional functionality and styling options over the standard Avalonia Flyout. Uses a custom presenter for enhanced theming and behavior.
<Button Content="Show Flyout">
<Button.Flyout>
<PleasantFlyout>
<StackPanel Spacing="8" Padding="16">
<TextBlock Text="Flyout content" />
<Button Content="Action" />
</StackPanel>
</PleasantFlyout>
</Button.Flyout>
</Button>Inherits all properties from Avalonia.Controls.Flyout:
Content- The content to display in the flyoutIsOpen- Whether the flyout is currently openPlacement- Where the flyout should be positioned relative to its targetShowMode- How the flyout should be shown- And other standard flyout properties
Control where the flyout appears:
<PleasantFlyout Placement="Bottom">
<!-- Content -->
</PleasantFlyout>Available placements: Top, Bottom, Left, Right, TopEdgeAligned, BottomEdgeAligned, etc.
Control how the flyout is shown:
<!-- Standard mode (default) -->
<PleasantFlyout ShowMode="Standard" />
<!-- transient mode -->
<PleasantFlyout ShowMode="Transient" />var flyout = new PleasantFlyout
{
Content = new TextBlock { Text = "Hello" }
};
flyout.ShowAt(targetControl);
flyout.Hide();<Button Content="Options">
<Button.Flyout>
<PleasantFlyout Placement="Bottom">
<StackPanel Width="200" Spacing="8">
<MenuItem Header="Copy" />
<MenuItem Header="Paste" />
<Separator />
<MenuItem Header="Settings" />
</StackPanel>
</PleasantFlyout>
</Button.Flyout>
</Button>PleasantFlyoutuses a custom presenter (PleasantFlyoutPresenter) for consistent theming with the PleasantUI design system- All standard Avalonia flyout functionality is preserved