Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Flyout and Popup APIs to make gap between them smaller #10492

Merged
merged 13 commits into from
Mar 7, 2023
5 changes: 3 additions & 2 deletions samples/ControlCatalog/Pages/ContextFlyoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public ContextFlyoutPage()
customContextRequestedBorder.AddHandler(ContextRequestedEvent, CustomContextRequested, RoutingStrategies.Tunnel);

var cancellableContextBorder = this.Get<Border>("CancellableContextBorder");
cancellableContextBorder.ContextFlyout!.Closing += ContextFlyoutPage_Closing;
cancellableContextBorder.ContextFlyout!.Opening += ContextFlyoutPage_Opening;
var flyout = (Flyout)cancellableContextBorder.ContextFlyout!;
flyout.Closing += ContextFlyoutPage_Closing;
flyout.Opening += ContextFlyoutPage_Opening;
}

private ContextPageViewModel? _model;
Expand Down
9 changes: 9 additions & 0 deletions samples/ControlCatalog/Pages/FlyoutsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@
</Flyout>
</Button.Flyout>
</Button>
<Button Content="Placement=Center">
<Button.Flyout>
<Flyout Placement="Center">
<Panel Width="100" Height="100">
<TextBlock Text="Flyout Content!" />
</Panel>
</Flyout>
</Button.Flyout>
</Button>
<Button Content="Placement=TopEdgeAlignedLeft">
<Button.Flyout>
<Flyout Placement="TopEdgeAlignedLeft">
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Flyouts/Flyout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Avalonia.Controls
{
public class Flyout : FlyoutBase
public class Flyout : PopupFlyoutBase
{
/// <summary>
/// Defines the <see cref="Content"/> property
Expand Down
Loading