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
So I was doing some testing to have a dynamic NavigationView based on a Users permissions, but I am running into an issue.
If I set the style on the top level, the style works fine. If I try and apply a style to a sub item, it will no longer show up.
Example:
[ObservableProperty]
private ObservableCollection<object> _TestMenuItems =
[
new NavigationViewItem
{
Content = "STATISTICS",
Icon = new SymbolIcon { Symbol = SymbolRegular.ArrowTrendingLines24 },
TargetPageType = typeof(StatisticsPage),
Style = new Style(typeof(NavigationViewItem))
},
new NavigationViewItem
{
Content = "ADMINISTRATION",
Icon = new SymbolIcon { Symbol = SymbolRegular.Beaker32 },
MenuItems = new object[]
{
new NavigationViewItem
{
Content = "STATISTICS 2",
Icon = new SymbolIcon { Symbol = SymbolRegular.ArrowTrendingLines24 },
TargetPageType = typeof(StatisticsPage),
Style = new Style(typeof(NavigationViewItem))
},
new NavigationViewItem
{
Content = "USERS",
Icon = new SymbolIcon { Symbol = SymbolRegular.Person28 },
TargetPageType = typeof(UsersPage)
},
new NavigationViewItem("AGENCIES", SymbolRegular.PeopleCommunity28, typeof(AgenciesPage))
}
}
];
"STATISTICS 2" is the only Item that doesn't show up. The only difference between it and "STATISTICS" is that it is a child of a NavigationViewItem rather than the NavigationView.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So I was doing some testing to have a dynamic NavigationView based on a Users permissions, but I am running into an issue.
If I set the style on the top level, the style works fine. If I try and apply a style to a sub item, it will no longer show up.
Example:
"STATISTICS 2" is the only Item that doesn't show up. The only difference between it and "STATISTICS" is that it is a child of a NavigationViewItem rather than the NavigationView.
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions