Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation issue with dynamically added NavigationViewItem #1076

Open
gunpal5 opened this issue May 3, 2024 · 1 comment
Open

Navigation issue with dynamically added NavigationViewItem #1076

gunpal5 opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gunpal5
Copy link

gunpal5 commented May 3, 2024

Describe the bug

I am trying to add a NavigationViewItem dynamically into the NavigationView. Its correctly showing the newly added item into the left navigation pane. but navigation service is not able to navigate by the TargetPageTag.

To Reproduce

var nav = _navigationService.GetNavigationControl();
var selected = nav.SelectedItem;
selected.MenuItems.Clear();
var mn = new NavigationViewItem()
{
    Content = project.ProjectName,
    Icon = new SymbolIcon { Symbol = SymbolRegular.TableLightning24 },
    TargetPageType = typeof(ProjectPage),
    TargetPageTag = "ProjectPage"
};
selected.MenuItems.Add(mn);

_navigationService.Navigate("ProjectPage");

Expected behavior

Navigation service should navigate to the newly added NavigationViewItem with the TargetPageTag

Screenshots

No response

OS version

Windows 11

.NET version

.net 8.0

WPF-UI NuGet version

3.0.4

Additional context

No response

@gunpal5 gunpal5 added the bug Something isn't working label May 3, 2024
@gunpal5 gunpal5 changed the title Bug title Navigation issue with dynamically added NavigationViewItem May 3, 2024
@FSRobot
Copy link

FSRobot commented May 4, 2024

try update to least,it's works on me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants