/wpf-mvvm-framework-use-services-with-dependency-injection

This example illustrates how to use the NavigationService with Dependency Injection.

Primary LanguageC#OtherNOASSERTION

DevExpress MVVM Framework - Use DevExpress Services with a Dependency Injection

This example illustrates how to use the NavigationService with Dependency Injection.

Use the AttachServiceBehavior to register services that require a specific view (such as FrameNavigationService, TabbedDocumentUIService, WizardService):

<dxwui:NavigationFrame>
    <dxmvvm:Interaction.Behaviors>
        <common:AttachServiceBehavior Service="{Binding NavigationService}"/>
    </dxmvvm:Interaction.Behaviors>
</dxwui:NavigationFrame>

Inject the service in the ViewModel's constructor:

public class MainViewModel {
    public INavigationService NavigationService { get; }

    public MainViewModel(INavigationService navigationService) =>
        NavigationService = navigationService;
}

Files to Look At

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)