Click here to Skip to main content
15,063,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using ribbon menu in my application where in i am trying to create Menu Items dynamically .Some thing like showing recently opened file names.
HTML
<ribbon:PopupButton Label="Recent">
                        <ribbon:Menu Height="122" HorizontalAlignment="Left" Margin="0,0,0,0"   Name="menu1" VerticalAlignment="Top" ItemsSource="{Binding RecentDocumentItems}"  >
                            <ribbon:Menu.ItemTemplate>
                                <DataTemplate>
                                    <ribbon:Button Command="{Binding:CommandParameter}" Label="{Binding RecentDocumentFileName}"></ribbon:Button>
                                </DataTemplate>
                            </ribbon:Menu.ItemTemplate>
                            <ribbon:Menu.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel></StackPanel>
                                </ItemsPanelTemplate>
                            </ribbon:Menu.ItemsPanel>
                        </ribbon:Menu>
                    </ribbon:PopupButton>

Here i have RecentDocumentItems observervable collection.
RecentDocumentItems contains the RecentDocumentFileName and CommandParameter as the relaycommand.
But the above code is not triggering the relaycommand.
Please help to find a solution. Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900