Issue with FooterMenuItems not showing Selection when manually added to xaml instead of FooterMenuItemsSource.
See original GitHub issueDescribe the bug
If you have a ObservableCollection
Bound to MenuItemsSource
But if you add FooterMenuItems
Manually in xaml, The selections do not appear on FooterMenuItems
Steps to reproduce the bug
Steps to reproduce the behavior:
Create a Blank UWP Project. Add 'Microsoft.UI.Xaml` Package.
In MainPage.xaml
add below
<muxc:NavigationView x:Name="MyNavigationView" >
<muxc:NavigationView.MenuItemTemplate>
<DataTemplate>
<muxc:NavigationViewItem Icon="Favorite" Content="{Binding Content}"/>
</DataTemplate>
</muxc:NavigationView.MenuItemTemplate>
<muxc:NavigationView.FooterMenuItems>
<muxc:NavigationViewItem Icon="Favorite" Content="Footer 1"/>
</muxc:NavigationView.FooterMenuItems>
</muxc:NavigationView>
In MainPage.xaml.cs
add below.
private void Page_Loaded(object sender, RoutedEventArgs e)
{
ObservableCollection<BindableItems> bindableItems = new ObservableCollection<BindableItems>();
for (int i = 1; i < 5; i++)
{
bindableItems.Add(new BindableItems() { Content = "Header " + i.ToString() });
}
MyNavigationView.MenuItemsSource = bindableItems;
}
public class BindableItems
{
public string Content { get; set; }
}
Expected behavior
Expecting Footer Item to also show selection on left side of MenuItem
Screenshots
Version Info
NuGet package version: Microsoft.UI.Xaml 2.5.0
Windows app type:
UWP | Win32 |
---|---|
Yes |
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | No |
May 2020 Update (19041) | Yes |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
NavigationView.FooterMenuItems Property
Gets the list of objects to be used as navigation items in the footer menu. This documentation applies to WinUI 2 for UWP...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@avknaidu The issue is being caused by the usage of the MenuItemTemplate. As a temporary workaround, you can try to use NavigationView without a datatemplate, e.g. by implementing your own “ElementFactory” and pass the processed collection to NavigationView.
I would like to look into this.