Proposal: Add binding support to MenuFlyout
Proposal: [Add binding support to MenuFlyout
Summary
Presently items in a flyout need to be defined ahead of time and cannot be bound to a collection. Add an ItemSource property and enable databinding.
Rationale
- Supports binding to arrays for displaying menu options corresponding to an array, enumeration or similar
- Adds consistency with most other elements which support this form of binding
Scope
| Capability | Priority |
|---|---|
| Developers should be able to bind a MenuFlyout to a source | Must |
🦙 There should be a corresponding ItemTemplate called out here too. This should also apply to the MenuBar APIs.
It should also be possible to compose a menu of pieces that are static XAML and also parts driven by a list (think having a recent file list be part of a menu or sub-menu like in VS Code):

<muxc:MenuBar>
<muxc:MenuBarItem Title="File">
<MenuFlyoutItem Text="New"/>
<MenuFlyoutSubItem Text="Open Recent...">
<MenuFlyoutItem Text="Reopen Closed Editor"/>
<MenuFlyoutSeparator/>
<muxc:MenuFlyoutItemSource ItemsSource="{Binding RecentFolders}">
<muxc:MenuFlyoutItemSource.ItemTemplate>
<DataTemplate>
<MenuFlyoutItem Text="{Binding FolderName}"/>
</DataTemplate>
</muxc:MenuFlyoutItemSource.ItemTemplate>
</muxc:MenuFlyoutItemSource>
<MenuFlyoutSeparator/>
<muxc:MenuFlyoutItemSource ItemsSource="{Binding RecentFiles}">
<muxc:MenuFlyoutItemSource.ItemTemplate>
<DataTemplate>
<MenuFlyoutItem Text="{Binding FileName}"/>
</DataTemplate>
</muxc:MenuFlyoutItemSource.ItemTemplate>
</muxc:MenuFlyoutItemSource>
<MenuFlyoutSeparator/>
<MenuFlyoutItem Text="More..."/>
</MenuFlyoutSubItem>
</muxc:MenuBarItem>
<muxc:MenuBarItem Title="Dynamic" ItemSource="{Binding MyMenuItems}">
<muxc:MenuBarItem.ItemTemplate>
<DataTemplate>
<MenuFlyoutItem Text="{Binding ItemTitle}"/>
</DataTemplate>
</muxc:MenuBarItem.ItemTemplate>
</mucx:MenuBarItem>
</muxc:MenuBar>
@JerryNixon saw you had an article here about this topic. Though the original extension code linked to is missing?
Think you'd want to add your extension to the Windows Community Toolkit for now until the WinUI team can get to improvements in WinUI directly?
Seems like enough people want the feature and have wanted it for a while. Anyone have an update on this?
This is basic stuff. Even the simplest of applications today show recent files list. That is impossible in XAML without this.
It's very troubling to see tickets like this. How did this get through any kind of design review?
Any updates on this issue? i've been trying to see if i can somehow make this work, i would like to populate a list of submenuflyoutitems by binding them to an observablecollection
That's too bad!
Really, how is something as basic that as this not implemented? This was reported in 2019, you've had 5 years to implement this basic feature... And I'd also like to know why anybody thought implementing this without binding support was a good idea.
Any update on this ?