Changing application theme breaks NavigationView

Open
#1,639 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
desktop, frontend

Research direction

Reproduce the issue on Windows 11 with .NET 9 using ApplicationThemeManager.Apply() and ApplicationThemeManager.ApplySystemTheme(), then trace the theme-change path affecting NavigationView and the window background. Done means both PaneDisplayMode variants remain visible and correctly sized, and the page background refreshes after every theme change.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

Changing the application theme with ApplicationThemeManager.Apply() or ApplicationThemeManager.ApplySystemTheme() breaks several UI components:

  • NavigationView Pane disappears with property PaneDisplayMode="Left", and the pane widens.
  • The NavigationView page disappears with property PaneDisplayMode="LeftFluent".
  • Page background does not refresh after first theme change, subsequent theme changes leave the background unupdated.
To Reproduce
  1. Change the application theme with ApplicationThemeManager.Apply() or ApplicationThemeManager.ApplySystemTheme()
  2. Observe issues with NavigationView element and window background
Expected behavior

The NavigationView element should behave as expected after theme changing

Screenshots

Before first theme change with PaneDisplayMode="Left":
Image

After first theme change:
Image

OS version

Windows 11

.NET version

.NET 9.0

WPF-UI NuGet version

Observed in v4.2.0, v4.1.0 and v4.0.3

Additional context

I'm looking to update my app (https://github.com/unchihugo/FluentFlyout) to use NavigationView structured settings, but this is issue holding me back from migrating.

Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lepoco/wpfui

All issues in lepoco/wpfui

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.