Skip to content

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

License

Notifications You must be signed in to change notification settings

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages