# ReaderNavigationService

- File ID: file:1aunxq2:readernavigationservice-cs
- Path: NexusReader.UI.Shared/Services/ReaderNavigationService.cs
- Role: service
- Layer: frontend

## Purpose

Provides navigation and in-memory reader state (current ebook, chapter index, total chapters, chapter title) and notifies subscribers when navigation changes; integrates with Blazor NavigationManager to navigate to a book view.

## Key Details

Holds reader navigation state in-memory for the UI and exposes an OnNavigationChanged event for subscribers; integrates with Blazor NavigationManager to navigate to a reader route. Methods include guard clauses to prevent invalid navigation and only notify subscribers when state actually changes.

## Symbols

- ReaderNavigationService: Provides navigation and in-memory reader state (current ebook, chapter index, total chapters, chapter title) and notifies subscribers when navigation changes; integrates with Blazor NavigationManager to navigate to a book view.
- ReaderNavigationService(): Constructor: captures NavigationManager dependency for performing route navigation.
- GoToChapter(): Validates a target chapter index, updates CurrentChapterIndex and notifies subscribers if valid.
- GoToNextChapter(): Advances to the next chapter when not at the last chapter (delegates to GoToChapter).
- GoToPreviousChapter(): Moves to the previous chapter when not at the first chapter (delegates to GoToChapter).
- UpdateMetadataAsync(): Updates in-memory metadata (index, total, title) only if values changed and notifies subscribers when a change occurred.
- NavigateToBook(): Sets the current ebook id, resets chapter index to 0 and triggers a route navigation to the reader page for the book.
- SetBook(): Sets the current ebook id and optionally the current chapter index without triggering navigation or notifications.
- NotifyNavigationChangedAsync(): Invokes all registered OnNavigationChanged handlers sequentially (awaiting each), if any are subscribed.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: Microsoft.AspNetCore.Components (NavigationManager)
- call-target: self
- call-target: self
- call-target: self
- call-target: self
- call-target: unknown
- interaction-target: _navigationManager.NavigateTo($"/reader/{bookId}") (framework call)
- interaction-target: await handler() — invokes subscriber code (external to this service)

## Coverage

- Symbols: 9
- Executable symbols: 8
- Executable symbols with control flow: 8
- Grounded edges: 9
- Unresolved references: 8
- Control-flow fragments: 8
- Unresolved jumps: 1
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 7

## Control Flow Fragments

- ReaderNavigationService: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- GoToChapter: 15 nodes, 16 edges, 1 jumps, 0 unsupported constructs
- GoToNextChapter: 12 nodes, 13 edges, 1 jumps, 0 unsupported constructs
- GoToPreviousChapter: 12 nodes, 13 edges, 1 jumps, 0 unsupported constructs
- UpdateMetadataAsync: 26 nodes, 30 edges, 1 jumps, 0 unsupported constructs
- NavigateToBook: 5 nodes, 4 edges, 0 jumps, 0 unsupported constructs
- SetBook: 4 nodes, 3 edges, 0 jumps, 0 unsupported constructs
- NotifyNavigationChangedAsync: 21 nodes, 24 edges, 1 jumps, 0 unsupported constructs

## Diagrams

### ReaderNavigationService Neighborhood

```mermaid
flowchart LR
    class_1baxnes_readernavigationservice("ReaderNavigationService")
    file_1aunxq2_readernavigationservice_cs("ReaderNavigationService")
    method_19botw9_readernavigationservice[["ReaderNavigationService()"]]
    method_1jsmnk6_gotonextchapter[["GoToNextChapter()"]]
    method_1lzew1d_gotopreviouschapter[["GoToPreviousChapter()"]]
    method_6z33me_navigatetobook[["NavigateToBook()"]]
    method_ecwzho_setbook[["SetBook()"]]
    method_l29i6z_gotochapter[["GoToChapter()"]]
    method_rb5d4b_notifynavigationchangedasync[["NotifyNavigationChangedAsync()"]]
    method_tx9z61_updatemetadataasync[["UpdateMetadataAsync()"]]
```

### ReaderNavigationService Execution Overview

```mermaid
flowchart TD
    class_1baxnes_readernavigationservice("ReaderNavigationService")
    method_19botw9_readernavigationservice[["ReaderNavigationService()"]]
    method_1jsmnk6_gotonextchapter[["GoToNextChapter()"]]
    method_1lzew1d_gotopreviouschapter[["GoToPreviousChapter()"]]
    method_6z33me_navigatetobook[["NavigateToBook()"]]
    method_ecwzho_setbook[["SetBook()"]]
    method_l29i6z_gotochapter[["GoToChapter()"]]
    method_rb5d4b_notifynavigationchangedasync[["NotifyNavigationChangedAsync()"]]
    method_tx9z61_updatemetadataasync[["UpdateMetadataAsync()"]]
    unresolved_unresolved_10uas86_interaction_target{"Unresolved: await handler() — invokes subscriber code (external to this service)"}
    unresolved_unresolved_16fqicv_call_target{"Unresolved: NotifyNavigationChangedAsync"}
    unresolved_unresolved_18mqycz_call_target{"Unresolved: GoToChapter"}
    unresolved_unresolved_1no0soz_call_target{"Unresolved: handler()"}
    unresolved_unresolved_1xs8wx_call_target{"Unresolved: NotifyNavigationChangedAsync"}
    unresolved_unresolved_8k298x_call_target{"Unresolved: GoToChapter"}
    unresolved_unresolved_qpytye_interaction_target{"Unresolved: _navigationManager.NavigateTo($\\"/reader/{bookId}\\") (framework call)"}
    class_1baxnes_readernavigationservice -->|contains| method_19botw9_readernavigationservice
    class_1baxnes_readernavigationservice -->|contains| method_1jsmnk6_gotonextchapter
    class_1baxnes_readernavigationservice -->|contains| method_1lzew1d_gotopreviouschapter
    class_1baxnes_readernavigationservice -->|contains| method_6z33me_navigatetobook
    class_1baxnes_readernavigationservice -->|contains| method_ecwzho_setbook
    class_1baxnes_readernavigationservice -->|contains| method_l29i6z_gotochapter
    class_1baxnes_readernavigationservice -->|contains| method_rb5d4b_notifynavigationchangedasync
    class_1baxnes_readernavigationservice -->|contains| method_tx9z61_updatemetadataasync
    class_1baxnes_readernavigationservice -->|unresolved interaction| unresolved_unresolved_10uas86_interaction_target
    class_1baxnes_readernavigationservice -->|unresolved interaction| unresolved_unresolved_qpytye_interaction_target
    method_1jsmnk6_gotonextchapter -->|unresolved call| unresolved_unresolved_8k298x_call_target
    method_1lzew1d_gotopreviouschapter -->|unresolved call| unresolved_unresolved_18mqycz_call_target
    method_l29i6z_gotochapter -->|unresolved call| unresolved_unresolved_1xs8wx_call_target
    method_rb5d4b_notifynavigationchangedasync -->|unresolved call| unresolved_unresolved_1no0soz_call_target
    method_tx9z61_updatemetadataasync -->|unresolved call| unresolved_unresolved_16fqicv_call_target
```

### GoToChapter() Control Flow

```mermaid
flowchart TD
    method_l29i6z_gotochapter__call_26_NotifyNavigationChangedAsync[["NotifyNavigationChangedAsync"]]
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__condition{"index < 0 || index >= TotalChapters"}
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__false("continue")
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__merge("merge")
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__true("exit")
    method_l29i6z_gotochapter__action_23_guard_clause_23__condition{"index < 0 || index >= TotalChapters"}
    method_l29i6z_gotochapter__action_23_guard_clause_23__false("continue")
    method_l29i6z_gotochapter__action_23_guard_clause_23__merge("merge")
    method_l29i6z_gotochapter__action_23_guard_clause_23__true("return (no state change)")
    method_l29i6z_gotochapter__action_25_state_change_25__linear("set CurrentChapterIndex")
    method_l29i6z_gotochapter__action_26_event_26__linear("notify subscribers")
    method_l29i6z_gotochapter__action_26_gotochapter_await_26_2__await[["Waits for async work"]]
    method_l29i6z_gotochapter__entry(["GoToChapter entry"])
    method_l29i6z_gotochapter__action_26_gotochapter_notification_26_1__linear[/"Sends notification"/]
    method_l29i6z_gotochapter__implicit_return(["return"])
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__condition -->|continue| method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__false
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__condition -->|exit| method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__true
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__false -->|next| method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__merge
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__merge -->|next| method_l29i6z_gotochapter__action_25_state_change_25__linear
    method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__true -->|next| method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__merge
    method_l29i6z_gotochapter__action_23_guard_clause_23__condition -->|continue| method_l29i6z_gotochapter__action_23_guard_clause_23__false
    method_l29i6z_gotochapter__action_23_guard_clause_23__condition -->|return no state change| method_l29i6z_gotochapter__action_23_guard_clause_23__true
    method_l29i6z_gotochapter__action_23_guard_clause_23__false -->|next| method_l29i6z_gotochapter__action_23_guard_clause_23__merge
    method_l29i6z_gotochapter__action_23_guard_clause_23__merge -->|next| method_l29i6z_gotochapter__action_23_gotochapter_guard_clause_23_0__condition
    method_l29i6z_gotochapter__action_23_guard_clause_23__true -->|next| method_l29i6z_gotochapter__action_23_guard_clause_23__merge
    method_l29i6z_gotochapter__action_25_state_change_25__linear -->|next| method_l29i6z_gotochapter__action_26_gotochapter_await_26_2__await
    method_l29i6z_gotochapter__action_26_event_26__linear -->|none| method_l29i6z_gotochapter__call_26_NotifyNavigationChangedAsync
    method_l29i6z_gotochapter__action_26_gotochapter_await_26_2__await -->|next| method_l29i6z_gotochapter__action_26_gotochapter_notification_26_1__linear
    method_l29i6z_gotochapter__action_26_gotochapter_notification_26_1__linear -->|next| method_l29i6z_gotochapter__action_26_event_26__linear
    method_l29i6z_gotochapter__call_26_NotifyNavigationChangedAsync -->|return| method_l29i6z_gotochapter__implicit_return
    method_l29i6z_gotochapter__entry -->|next| method_l29i6z_gotochapter__action_23_guard_clause_23__condition
```

### GoToNextChapter() Control Flow

```mermaid
flowchart TD
    method_1jsmnk6_gotonextchapter__call_33_GoToChapter[["GoToChapter"]]
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__condition{"CurrentChapterIndex < TotalChapters - 1"}
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__false("false")
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__merge("merge")
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__true("true")
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__condition{"CurrentChapterIndex < TotalChapters - 1"}
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__false("no-op")
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__merge("merge")
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__true("call GoToChapter")
    method_1jsmnk6_gotonextchapter__action_33_gotonextchapter_await_33_1__await[["Waits for async work"]]
    method_1jsmnk6_gotonextchapter__entry(["GoToNextChapter entry"])
    method_1jsmnk6_gotonextchapter__implicit_return(["return"])
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__condition -->|false| method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__false
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__condition -->|true| method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__true
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__false -->|next| method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__merge
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__merge -->|next| method_1jsmnk6_gotonextchapter__action_33_gotonextchapter_await_33_1__await
    method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__true -->|next| method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__merge
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__condition -->|no-op| method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__false
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__condition -->|call GoToChapter| method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__true
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__false -->|next| method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__merge
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__merge -->|next| method_1jsmnk6_gotonextchapter__action_31_gotonextchapter_branch_31_0__condition
    method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__true -->|next| method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__merge
    method_1jsmnk6_gotonextchapter__action_33_gotonextchapter_await_33_1__await -->|CurrentChapterIndex + 1| method_1jsmnk6_gotonextchapter__call_33_GoToChapter
    method_1jsmnk6_gotonextchapter__call_33_GoToChapter -->|return| method_1jsmnk6_gotonextchapter__implicit_return
    method_1jsmnk6_gotonextchapter__entry -->|next| method_1jsmnk6_gotonextchapter__action_31_guard_clause_31__condition
```

### GoToPreviousChapter() Control Flow

```mermaid
flowchart TD
    method_1lzew1d_gotopreviouschapter__call_41_GoToChapter[["GoToChapter"]]
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__condition{"CurrentChapterIndex > 0"}
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__false("false")
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__merge("merge")
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__true("true")
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__condition{"CurrentChapterIndex > 0"}
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__false("no-op")
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__merge("merge")
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__true("call GoToChapter")
    method_1lzew1d_gotopreviouschapter__action_41_gotopreviouschapter_await_41_1__await[["Waits for async work"]]
    method_1lzew1d_gotopreviouschapter__entry(["GoToPreviousChapter entry"])
    method_1lzew1d_gotopreviouschapter__implicit_return(["return"])
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__condition -->|false| method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__false
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__condition -->|true| method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__true
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__false -->|next| method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__merge
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__merge -->|next| method_1lzew1d_gotopreviouschapter__action_41_gotopreviouschapter_await_41_1__await
    method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__true -->|next| method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__merge
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__condition -->|no-op| method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__false
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__condition -->|call GoToChapter| method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__true
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__false -->|next| method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__merge
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__merge -->|next| method_1lzew1d_gotopreviouschapter__action_39_gotopreviouschapter_branch_39_0__condition
    method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__true -->|next| method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__merge
    method_1lzew1d_gotopreviouschapter__action_41_gotopreviouschapter_await_41_1__await -->|CurrentChapterIndex - 1| method_1lzew1d_gotopreviouschapter__call_41_GoToChapter
    method_1lzew1d_gotopreviouschapter__call_41_GoToChapter -->|return| method_1lzew1d_gotopreviouschapter__implicit_return
    method_1lzew1d_gotopreviouschapter__entry -->|next| method_1lzew1d_gotopreviouschapter__action_39_guard_clause_39__condition
```

### UpdateMetadataAsync() Control Flow

_Warnings: diagram method_tx9z61_updatemetadataasync__fragment_diagram exceeds preferred complexity thresholds (26 nodes, 30 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_tx9z61_updatemetadataasync__call_54_NotifyNavigationChangedAsync[["NotifyNavigationChangedAsync"]]
    method_tx9z61_updatemetadataasync__action_48_state_change_48__linear("conditionally update CurrentChapterIndex/TotalChapters/ChapterTitle")
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__condition{"CurrentChapterIndex != currentIndex"}
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__false("false")
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__merge("merge")
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__true("true")
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__condition{"TotalChapters != totalChapters"}
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__false("false")
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__merge("merge")
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__true("true")
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__condition{"ChapterTitle != title"}
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__false("false")
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__merge("merge")
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__true("true")
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__condition{"changed == true"}
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__false("no-op")
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__merge("merge")
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__true("notify")
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__condition{"changed"}
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__false("false")
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__merge("merge")
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__true("true")
    method_tx9z61_updatemetadataasync__action_54_updatemetadataasync_await_54_5__await[["Waits for async work"]]
    method_tx9z61_updatemetadataasync__entry(["UpdateMetadataAsync entry"])
    method_tx9z61_updatemetadataasync__action_54_updatemetadataasync_notification_54_4__linear[/"Sends notification"/]
    method_tx9z61_updatemetadataasync__implicit_return(["return"])
    method_tx9z61_updatemetadataasync__action_48_state_change_48__linear -->|next| method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__condition
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__condition -->|false| method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__false
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__condition -->|true| method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__true
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__false -->|next| method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__merge
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__merge -->|next| method_tx9z61_updatemetadataasync__action_48_state_change_48__linear
    method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__true -->|next| method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__merge
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__condition -->|false| method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__false
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__condition -->|true| method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__true
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__false -->|next| method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__merge
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__merge -->|next| method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__condition
    method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__true -->|next| method_tx9z61_updatemetadataasync__action_49_updatemetadataasync_branch_49_1__merge
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__condition -->|false| method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__false
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__condition -->|true| method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__true
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__false -->|next| method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__merge
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__merge -->|next| method_tx9z61_updatemetadataasync__action_52_guard_clause_52__condition
    method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__true -->|next| method_tx9z61_updatemetadataasync__action_50_updatemetadataasync_branch_50_2__merge
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__condition -->|no-op| method_tx9z61_updatemetadataasync__action_52_guard_clause_52__false
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__condition -->|notify| method_tx9z61_updatemetadataasync__action_52_guard_clause_52__true
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__false -->|next| method_tx9z61_updatemetadataasync__action_52_guard_clause_52__merge
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__merge -->|next| method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__condition
    method_tx9z61_updatemetadataasync__action_52_guard_clause_52__true -->|next| method_tx9z61_updatemetadataasync__action_52_guard_clause_52__merge
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__condition -->|false| method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__false
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__condition -->|true| method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__true
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__false -->|next| method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__merge
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__merge -->|next| method_tx9z61_updatemetadataasync__action_54_updatemetadataasync_await_54_5__await
    method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__true -->|next| method_tx9z61_updatemetadataasync__action_52_updatemetadataasync_branch_52_3__merge
    method_tx9z61_updatemetadataasync__action_54_updatemetadataasync_await_54_5__await -->|next| method_tx9z61_updatemetadataasync__action_54_updatemetadataasync_notification_54_4__linear
    method_tx9z61_updatemetadataasync__action_54_updatemetadataasync_notification_54_4__linear -->|none| method_tx9z61_updatemetadataasync__call_54_NotifyNavigationChangedAsync
    method_tx9z61_updatemetadataasync__call_54_NotifyNavigationChangedAsync -->|return| method_tx9z61_updatemetadataasync__implicit_return
    method_tx9z61_updatemetadataasync__entry -->|next| method_tx9z61_updatemetadataasync__action_48_updatemetadataasync_branch_48_0__condition
```

### NotifyNavigationChangedAsync() Control Flow

_Warnings: diagram method_rb5d4b_notifynavigationchangedasync__fragment_diagram exceeds preferred complexity thresholds (21 nodes, 24 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_rb5d4b_notifynavigationchangedasync__call_78_handler_[["handler()"]]
    method_rb5d4b_notifynavigationchangedasync__action_73_event_read_73__linear("capture invocation list")
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__condition{"handlers != null"}
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__false("no-op")
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__merge("merge")
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__true("iterate-and-await")
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__condition{"handlers != null"}
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__false("false")
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__merge("merge")
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__true("true")
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_body[["foreach (var handler in handlers.Cast<Func<Task>>()) { await handler(); }"]]
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_entry("iterate over registered handlers")
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_exit("exit loop")
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_body[["foreach (var handler in handlers.Cast<Func<Task>>())"]]
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_entry("var handler in handlers.Cast<Func<Task>>()")
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_exit("Leaves the loop when the condition no longer holds.")
    method_rb5d4b_notifynavigationchangedasync__action_78_notifynavigationchangedasync_await_78_3__await[["Waits for async work"]]
    method_rb5d4b_notifynavigationchangedasync__entry(["NotifyNavigationChangedAsync entry"])
    method_rb5d4b_notifynavigationchangedasync__action_71_notifynavigationchangedasync_notification_71_0__linear[/"Sends notification"/]
    method_rb5d4b_notifynavigationchangedasync__action_78_external_call_78__linear("await subscriber delegate")
    method_rb5d4b_notifynavigationchangedasync__implicit_return(["return"])
    method_rb5d4b_notifynavigationchangedasync__action_71_notifynavigationchangedasync_notification_71_0__linear -->|next| method_rb5d4b_notifynavigationchangedasync__action_73_event_read_73__linear
    method_rb5d4b_notifynavigationchangedasync__action_73_event_read_73__linear -->|next| method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__condition
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__condition -->|no-op| method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__false
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__condition -->|iterate-and-await| method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__true
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__false -->|next| method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__merge
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__merge -->|next| method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__condition
    method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__true -->|next| method_rb5d4b_notifynavigationchangedasync__action_74_guard_clause_74__merge
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__condition -->|false| method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__false
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__condition -->|true| method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__true
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__false -->|next| method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__merge
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__merge -->|next| method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_entry
    method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__true -->|next| method_rb5d4b_notifynavigationchangedasync__action_74_notifynavigationchangedasync_branch_74_1__merge
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_body -->|continue| method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_entry
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_entry -->|iterate| method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_body
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_entry -->|exit| method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_exit
    method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_exit -->|next| method_rb5d4b_notifynavigationchangedasync__action_78_notifynavigationchangedasync_await_78_3__await
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_body -->|continue| method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_entry
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_entry -->|var handler in handlers.Cast Func Task>>| method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_body
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_entry -->|Leaves the loop when the condition no longer holds.| method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_exit
    method_rb5d4b_notifynavigationchangedasync__action_76_notifynavigationchangedasync_loop_76_2__loop_exit -->|next| method_rb5d4b_notifynavigationchangedasync__action_76_loop_76__loop_entry
    method_rb5d4b_notifynavigationchangedasync__action_78_external_call_78__linear -->|none invokes subscriber delegate| method_rb5d4b_notifynavigationchangedasync__call_78_handler_
    method_rb5d4b_notifynavigationchangedasync__action_78_notifynavigationchangedasync_await_78_3__await -->|next| method_rb5d4b_notifynavigationchangedasync__action_78_external_call_78__linear
    method_rb5d4b_notifynavigationchangedasync__call_78_handler_ -->|return| method_rb5d4b_notifynavigationchangedasync__implicit_return
    method_rb5d4b_notifynavigationchangedasync__entry -->|next| method_rb5d4b_notifynavigationchangedasync__action_71_notifynavigationchangedasync_notification_71_0__linear
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 1 unresolved jumps.
- Warning: control-flow: diagram method_tx9z61_updatemetadataasync__fragment_diagram exceeds preferred complexity thresholds (26 nodes, 30 edges).
- Warning: control-flow: diagram method_rb5d4b_notifynavigationchangedasync__fragment_diagram exceeds preferred complexity thresholds (21 nodes, 24 edges).
