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;
}
(you will be redirected to DevExpress.com to submit your response)