WPF Ribbon - Backstage Documents

Ribbon for WPF Forum

Posted 3 years ago by Ruwe
Version: 20.1.1
Avatar

Good day.

I have a Ribbon Backstage menu, with recent document menu, when I click on a document reference, it closes the backstage menu, is there a way to prevent this?

On another note, how can I change the look of a selected tab in the ribbon (not backstage/application menu), to "look in depth", not just a line?

Looking forward to hearing from you.

Kind regards

Comments (7)

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

Hi Ruwe,

The ribbon:Button controls used there don't have StaysOpenOnClick set to true, so they do the default action of closing Backstage (treating it like a Popup) when clicked.

You might be able to include an implicit Style in RecentDocumentMenu.Resources that targets ribbon:Button and sets StaysOpenOnClick to true.

You can create a custom Style/Template for the ribbon:Tab type if you'd like to alter how ribbon tabs render.  Since your company licenses WPF Studio, you can download the default styles/templates from your account so you have a base to start with.


Actipro Software Support

Posted 3 years ago by Ruwe
Avatar

Thank you for your quick response, and in detail response.

Can you maybe provide an example for the "implicit style" example you mentioned, please?

Thank you in advance.

[Modified 3 years ago]

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

Hi Ruwe,

I was thinking something like this, but when testing it, it didn't seem to take:

<ribbon:RecentDocumentMenu ...>
 <ribbon:RecentDocumentMenu.Resources>
  <Style TargetType="ribbon:Button">
   <Setter Property="StaysOpenOnClick" Value="True" />
  </Style>
 </ribbon:RecentDocumentMenu.Resources>
</ribbon:RecentDocumentMenu ...>

Unfortunately you might need to clone our default ItemTemplate value for RecentDocumentMenu and set the Button's StaysOpenOnClick="True" in it.  However that Button references other value converters and an internal Style that would also need to cloned so it's a bit of a rabbit hole.  That being said, all our defaults for this are in our default styles/templates in the Menu.xaml file.


Actipro Software Support

Posted 3 years ago by Ruwe
Avatar

Thank you for your thorough feedback, I appreciate it greatly.

Let me ask this, is there a chance that a "StaysOpenOnClick" property could be added to the next version for the RecentDocumentMenu?

If so, I believe I could be able to put this on hold, rather than hacking something together.

What do you think?

Regards

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

Hi Ruwe,

Can you explain the scenario where you want Backstage to remain open when you click on a recent document to open it?  I wouldn't think people would want to do that kind of thing.


Actipro Software Support

Posted 3 years ago by Ruwe
Avatar

Good day.

When my application opens, there are recent documents, so when they are clicked on, they interface is loaded in the background.

Now what happens, I click on the recent document to load, and it closes the backstage menu, and shows the interface, which is not initialized yet.

So I want to prevent it from closing until everything is initialized, does that make sense?

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

Hi Ruwe,

Thank you for the explanation.  Taking a look at the RecentDocumentMenu control configuration, I'm not sure we can add a StaysOpenOnClick option there because the ribbon:Button that would need to consume it is within the ItemTemplate for the MenuItem container element that is generated for each IDocumentReference item.  We tried various things to try and push the value down to the ribbon:Button from the RecentDocumentMenu, but due to the multiple levels/templates, it wasn't taking via bindings.  Unfortunately you might have to do what we mentioned in a previous reply by replacing our ItemTemplate.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.