RecentDocumentManager removing invalid entries

Ribbon for WPF Forum

Posted 4 years ago by Hamid Noorbakhsh
Version: 16.1.0631
Avatar

I am using RecentDocumentManager and everything works great. Some of the documents can be moved/removed from disk, so when I try to open them and I can't find them, I ask the user if they need to be removed from the RecentDocumentManager and I do it. All and all everything is good EXCEPT, I do not want to switch from BackStage. If a document is not available, I want to STAY in Backstage and cancel this automatic switching? it is just simply in a BackStageTab.

Comments (3)

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

Hi Hamid,

The Ribbon ButtonBase's OnPreviewClick handler will close popups when the button is clicked unless the Button's StaysOpenOnClick property is set to true.  Since your company licenses WPF Studio, take a look at the Menu.xaml file in the default Ribbon styles/templates.  Look at the RecentDocumentMenu Style and you'll see several places where ItemTemplate is set based on the context.  You can update the buttons there to set StaysOpenOnClick="True" and then if you do successfully open a new document, be sure to close the Backstage if it isn't still auto-closing.


Actipro Software Support

Posted 4 years ago by Hamid Noorbakhsh
Avatar

Great! I saw the StaysOpenOnClick="True" but could not get to that Button and was not sure what the ItemTemplate was, but you are right, I do have the Styles, etc so I can just overwrite/add that in there. Seems reasonable and I should be able to find it.

 

Thank you.

Posted 4 years ago by Hamid Noorbakhsh
Avatar

Tried it and works great, i just have to close it myself on a successful 'Open', which I already had an AttachedProperty for other things.

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.