Binding to a RecentDocumentManager problem

Ribbon for WPF Forum

Posted 12 years ago by Tom P.
Version: 11.2.0551
Avatar
Previously, I had success using RecentDocumentManager via XAML when the RecentDocumentManager object was inline in the XAML. However, I'm now trying a more MVVM approach, and data binding to a RecentDocumentManager property on my ViewModel.

It works great if my BackstageTab is also inline XAML. However, if I instead use a Style for my BackstageTab, it fails.

I've created a very small simple project which demonstrates the issue. I'd be happy to send it to you.

The problem is that the Documents never show up in the Styled and Data-bound case. I've used Snoop on it, and it appears the RecentDocumentMenu.Manager property has a Local value. If I do the Snoop Clear/Reset on Manager, it suddenly works, and becomes a ParentTemplate value.

I'm wondering if this is an example of the DependencyObject.SetCurrentValue() issue.

[Modified at 02/16/2012 12:25 PM]

Comments (4)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tom,

It looks like we do initialize it with a local value in the RecentDocumentMenu constructor.

If you want to send over your simple project (rename the .zip file extension) then we can look at it and see if we can make some tweaks for the next maintenance release to fix the problem.


Actipro Software Support

Posted 12 years ago by Tom P.
Avatar
Sounds great! I've sent the sample, which was initially based off the RibbonWindow Visual Studio component wizard.

I have found a work around in the mean time, which isn't particularly MVVM. Instead of hosting the RecentDocumentManager in my ViewModel, I have a property for RecentDocumentMenu, and bind to that as the Content of a ContentControl. It works perfectly.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tom,

Thanks for the sample. We've updated our code for the next maintenance release to allow this to work.


Actipro Software Support

Posted 12 years ago by Tom P.
Avatar
I know I've said it before, but give yourselves a raise! Your technical support is fantastic.
The latest build of this product (v24.1.1) 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.