lepoco / lepoco/wpfui

The NavigationView control cannot be used

Open
#761 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

/
Ideally, I would add NavigationView that can be used immediately through simple configuration, but after extensive experimentation and sample review, it still cannot solve this problem effectively. NavigationView is currently designed based on mvvlight and even has deep binding with MvvLight. I saw the simple.demo you provided, which requires navigate (type) in the MainWindow Load event first. I don't know the reason why they all do this. There is an IsActive dependency property in the NavigationItem control, which has a mandatory dependency relationship with the TargetPageType property. If TargetPageType=null, it is even impossible to determine the IsActive value of the NavigationItem, which is reflected in whether the NavigationItem is selected on the UI. NavigationItem cannot determine IsActive, IsSelected, and other states using the click event, and the user experience is truly indescribable. I just want to use it in a traditional way, but everything needs to be used in conjunction with mvvlight to function properly, and I can't even use Prism. Is it because I crave too much?

To Reproduce

Create a new project, introduce necessary xamls, directly add the NavigationView control, set the content attribute, and nothing will be displayed on the interface

Expected behavior

It should be possible to briefly display the navigation UI, similar to this:

image

In an ideal situation, WPFUI should focus on the UI and not be too deeply coupled with various frameworks. Isn't this possible to reduce maintenance costs more? Let users decide on their own development approach, whether to use traditional code handle event driven, common-tools-mvvmlight, or Prism, and there should not be too much coupling,

Screenshots

MainWindow xaml:

image

MainWindow c#:
image

Running results:
image

OS version

win11 22H2

.NET version

.net7

WPF-UI NuGet version

all version,2.1-3.0.0-preview.6

Additional context

Similar UI ->ui.wpf.modern

https://github.com/InkoreStudios/UI.WPF.Modern

.csproj file
image

MainWindow xaml:
image

Running results:

image

The only regret is that ui.wpf.modern uses Winrt, which consumes a high amount of system resources and may have compatibility issues. Additionally, no one will continue to maintain Winrt in the later stages, which is a sad thing. Apart from waiting indefinitely for Microsoft to provide the Win11 style theme, we cannot find any ideal wpf skins to use

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.

Research direction

Start with the MainWindow XAML and C# shown in the issue, then inspect how NavigationView and NavigationItem use TargetPageType, IsActive, and selection state. Reproduce the case where NavigationView is added with a content attribute but displays nothing; done would mean the navigation UI can be used without mandatory MVVM Light coupling and supports the expected traditional setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.