Skip to content

DataContext is set too early when using MEF #19

@maikhanns

Description

@maikhanns

We have migrated an WPF application from an old WPFApplicationFramework version to System.WAF.

Our application uses MEF and a plugin class that inherits from ViewModel. The plugins have an additional Initialize method. So far the DataContext was set after this method. (Dispatcher.BeginInvoke in ViewModel)

Since System.WAF 4.0.0-alpha3 that behavior changed. The DataContext is already set after the MEF import and before our Initialize method.

This leads to the fact that bindings are already executed on a plugin that is not initialized for us. Within the application there are e.g. also DataContextChanged events which are now executed too early.

Is it possible to prevent the setting of the DataContext in the OnImportsSatisfied or to get more control over it?

Thanks in advance :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions