DocumentManager tweaks

Ribbon for WPF Forum

Posted 6 years ago by Ralph
Version: 17.2.0662
Avatar

1. Is it possible to force the RecentDocumentManager to display just the file names without extension?

2. How to implement a "Remove" context menu allowing the user to remove unwanted files from history?  When I add a ContextMenu to ribbon:RecentDocumentMenu, it is displayed for the file list header only, but not for individual items (a standard Quick Toolbar context menu appears instead).

Comments (2)

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

I believe it shows the IDocumentReference.Name property value.  That property is get/set so you can alter it if you like.

The RecentDocumentMenu's ItemTemplate has a ribbon:Button in it.  This makes it so each item has a clickable button.  You might be able to make a class that inherits RecentDocumentMenu and overrides OnContextMenu and walk up the visual tree of the e.OriginalSource to look for a ribbon:Button that has a DocumentReference in its DataContext.  Then handle the event and show the context menu for that button.


Actipro Software Support

Posted 6 years ago by Ralph
Avatar

Brilliant, it works!

Thanks a lot!

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.