Skip to content

fix #136 - Wire native navigation and add titlebar buttons#137

Merged
Redth merged 1 commit intomainfrom
dev/aritchie/136-windows-menu
Mar 31, 2026
Merged

fix #136 - Wire native navigation and add titlebar buttons#137
Redth merged 1 commit intomainfrom
dev/aritchie/136-windows-menu

Conversation

@aritchie
Copy link
Copy Markdown
Collaborator

Expose native-to-Blazor navigation on the toolbar service and hook it up in the main layout, plus add Doctor and Settings buttons to the Windows title bar.

Details:

  • IToolbarService: added NavigationRequested event and RequestNavigation(string) API to request navigation from native UI.
  • ToolbarService: implemented the event and RequestNavigation invocation.
  • MainLayout.razor: subscribes/unsubscribes to ToolbarService.NavigationRequested on Windows and navigates via NavManager.NavigateTo when requested.
  • WindowsTitleBarManager: added Doctor and Settings sidebar buttons (Doctor requests navigation to "/doctor", Settings opens the settings dialog), added a CreateSidebarButton helper to create styled icon buttons with tooltips and pointer hover effects.

This enables native titlebar controls to trigger Blazor route navigation and provides new titlebar actions on Windows.

Expose native-to-Blazor navigation on the toolbar service and hook it up in the main layout, plus add Doctor and Settings buttons to the Windows title bar.

Details:
- IToolbarService: added NavigationRequested event and RequestNavigation(string) API to request navigation from native UI.
- ToolbarService: implemented the event and RequestNavigation invocation.
- MainLayout.razor: subscribes/unsubscribes to ToolbarService.NavigationRequested on Windows and navigates via NavManager.NavigateTo when requested.
- WindowsTitleBarManager: added Doctor and Settings sidebar buttons (Doctor requests navigation to "/doctor", Settings opens the settings dialog), added a CreateSidebarButton helper to create styled icon buttons with tooltips and pointer hover effects.

This enables native titlebar controls to trigger Blazor route navigation and provides new titlebar actions on Windows.
Copilot AI review requested due to automatic review settings March 31, 2026 13:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables native UI (Windows title bar) to trigger Blazor route navigation by extending IToolbarService with a navigation request event/API, wiring it up in MainLayout, and adding Doctor/Settings actions to the Windows title bar.

Changes:

  • Extend IToolbarService/ToolbarService with NavigationRequested + RequestNavigation(route) to request Blazor navigation from native UI.
  • Subscribe to ToolbarService.NavigationRequested in MainLayout.razor (Windows) and navigate via NavigationManager.NavigateTo.
  • Add Doctor and Settings title bar buttons on Windows, plus a CreateSidebarButton helper for consistent styling/hover/tooltip behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/MauiSherpa/Services/WindowsTitleBarManager.cs Adds Doctor/Settings titlebar buttons and a reusable sidebar button factory.
src/MauiSherpa/Components/MainLayout.razor Subscribes to native navigation requests and performs Blazor navigation on Windows.
src/MauiSherpa.Core/Services/ToolbarService.cs Implements the new navigation request event and method on the toolbar service.
src/MauiSherpa.Core/Interfaces.cs Adds the new navigation request event/method to IToolbarService.

@Redth Redth merged commit e2b2102 into main Mar 31, 2026
11 checks passed
@Redth Redth deleted the dev/aritchie/136-windows-menu branch March 31, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants