You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #2958 from unoplatform/copilot/fix-logger-exception-splash-screen
fix(Navigation): Use NullLogger fallback with diagnostic warning and add documentation to prevent crash when Region.Attached is used in ExtendedSplashScreen
Copy file name to clipboardExpand all lines: doc/Learn/Navigation/HowTo-Regions.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,41 @@ A Region is used to link specific sectors of a view to individual items on a nav
11
11
> [!NOTE]
12
12
> If an app only uses basic navigation between pages without any nested views or pages, it is not necessary to register routes. In such cases, the default `Frame` and navigator are sufficient to manage the navigation, simplifying the setup and reducing the need for additional configuration.
13
13
14
+
## Avoid Using Region.Attached in Shell.xaml Content
15
+
16
+
When using the navigation extensions with an `ExtendedSplashScreen` in your `Shell.xaml`, do **not** add `Region.Attached="True"` to content inside the `ExtendedSplashScreen`. This includes any custom content you might want to add while the splash screen is loading.
17
+
18
+
**Incorrect Usage (Avoid This):**
19
+
20
+
```xml
21
+
<utu:ExtendedSplashScreenx:Name="Splash">
22
+
<!-- DO NOT add Region.Attached here - navigation host is not ready yet -->
23
+
<Grid uen:Region.Attached="True"
24
+
uen:Region.Navigator="Visibility">
25
+
<!-- This will cause initialization issues -->
26
+
</Grid>
27
+
</utu:ExtendedSplashScreen>
28
+
```
29
+
30
+
**Why:** The `Region.Attached` property triggers navigation region initialization, which requires the navigation host (and its dependency injection container) to be fully started. During `Shell.xaml` construction, the host is not yet ready, leading to initialization issues.
31
+
32
+
**Correct Approach:** The navigation system handles the initial navigation automatically from the Shell to your initial page. You don't need to manually add region-attached content inside the `ExtendedSplashScreen`. Instead, define your regions on your actual pages (like `MainPage`) where the navigation host is fully initialized.
# Navigate between regions inside the same page (Region-based navigation)
8
8
9
+
> [!IMPORTANT]
10
+
> **Do not use `Region.Attached="True"` inside Shell.xaml or ExtendedSplashScreen content.** The navigation host is not ready during Shell construction. Define regions on your actual pages (like `MainPage`) instead.
11
+
9
12
## Link navigation control with content using regions
0 commit comments