Backstage DataContext is changing on runtime.

Editors for WPF Forum

Posted 4 years ago by Daniel Constantin - ModuleWorks GmbH
Version: 19.1.0684
Avatar

Hi,

I am trying to use a different view model for the Backstage to not have too much code inside the main view model.

The thing is that the DataContext is changing to the main view model when I am trying to open the Backstage.

There is an event DataContextChanged which helped me finding that the DataContext is not the same as it was on the Backstage constructor, after the InitializeComponent() method.

Kind regards,

Daniel

Comments (1)

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

Hi Daniel,

There is code that will bind the Ribbon.DataContext to the Backstage.DataContext when Backstage is opening.  I think that's what you are running into here.  Could you set the Ribbon.DataContext instead, or perhaps update the Backstage's DataContext once it's added to a visual parent?

On a side note, for the updates we've done to Ribbon for the 2020.1 version, Backstage is displayed in a new way that will not set any DataContext like in v2019.1 and earlier.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.