Hello All,
I am using Infragistics WPF NetAdvantage 2010, Volume 2. In what follows, please assume the following definition exists: xmlns:igRibbon="http://infragistics.com/Ribbon"
My top-level structure is as follows:
<igRibbon:XamRibbonWindow ...> <igRibbon:RibbonWindowContentHost> <igRibbon:RibbonWindowContentHost.Ribbon> <igRibbon:XamRibbon ...> <igRibbon:XamRibbon.ApplicationMenu> <igRibbon:ApplicationMenu ...>
I have populated ApplicationMenu.RecentItems, an ObservableCollection<>, with a list of recently-used files (as strings).
What code do I need to put in place to respond to the user selecting one of these files? In my handler code, how can I get at the filename string?
Thanks,Dave
I too am struggling with this. The examples included do not actually show how to do anything when an item is clicked...
Well I've come up with a solution but it isn't very pretty...
Instead of adding a string or a textblock to the RecentItems collection, I add an instance of Infragistics.Windows.Ribbon.ButtonTool and set the Caption property to whatever I want that item to display as, set the Tag property to the actual value I want to be able to retrieve when someone clicks it, and add an event handler for the click event. The event handler I point it to then casts the Sender argument as a ButtonTool and gets the Tag property from it. Of course I also then need to remove the event handler for each instance whenever I remove an item from the RecentItems collection.
Hello Chris,
Thank you for your feedback. I believe that other community members may benefit from this as well.
Thanks again.