Repository navigation
feat(avalonia): P1 overlays : dialog, drawer, sheet, dropdown, popover - #8
Merged
Merged
Conversation
added 4 commits
October 8, 2026 08:50
The base layer for the P1 overlays, matching the MAUI shell's API: ShellTriggerView (a ShellUI Button inside handles its click and activates the trigger), ShellPopoverHost for trigger + floating panel, ShellOverlayHost for modal content, ShellDismiss (Escape closes the overlay on top), ShellPopups (one menu open at a time) and ShellMotion for the open/close transitions. Both hosts put their content in an Avalonia Popup drawn in the window's overlay layer instead of moving it into a page layer as MAUI does: the content stays in the logical tree, so it inherits the theme and DataContext, and parts find their component with FindParentOfType (element-extensions, now with an Avalonia version). The popover host gets Avalonia's placement, flipping and click-outside dismissal; the dismissing click is swallowed so it can't reopen the menu.
dialog, drawer, sheet, dropdown and popover with their triggers and parts, with the MAUI names, properties, sides and animations. Content parts collect their XAML children in Items. Slide-in offsets are formatted with the invariant culture, since some cultures write the minus sign as U+2212 and TransformOperations.Parse rejects it. TemplateContentTests no longer requires 'using Avalonia' in an Avalonia template (Dialog and the triggers need none); it checks for MAUI types instead. Checked: every P1 entry installs alone into a fresh 'dotnet new avalonia.app' and builds with 0 warnings; all components together in one app build; in the demo each overlay opens from its trigger button, dropdown and popover flip above a trigger at the bottom, Escape closes the dialog, picking an item fires Clicked and closes the menu, DialogClose closes the dialog, light and dark.
The header said 'Setting up your MAUI project' before the platform was detected, so Avalonia projects (and folders with no project) got the MAUI wording. It now says 'Setting up your project'; the line after it names the detected platform.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second Avalonia slice of Phase 2: the P1 overlays, completing the Phase 2 component target (P0 + P1).
shell
ShellTriggerView(a ShellUI Button inside activates the trigger),ShellPopoverHost(trigger + floating panel),ShellOverlayHost(modal content),ShellDismiss(Escape closes the overlay on top),ShellPopups(one menu open at a time),ShellMotion(open/close transitions)Popupin the window's overlay layer, so it stays in the logical tree: theme, DataContext andFindParentOfTypework as declared; dropdown/popover get Avalonia's placement, flip and click-outside dismissalelement-extensionsgets an Avalonia version;Buttonactivates an enclosing triggerComponents
Side), dropdown (+ trigger, content, item), popover (+ trigger, content), with the MAUI names, properties and animationsTransformOperations.Parserejects)Verification
dotnet build ShellUI.Native.slnx: 0 warnings; tests 673/673; each commit builds the Avalonia demo and passes the testsdotnet new avalonia.appand builds with 0 warnings; all Avalonia components together in one app buildClickedand closes the menu;DialogClosecloses the dialog; light and darkKnown gaps