[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
    Getting Started
    Services in ViewModelBase descendants
    Services in POCO objects
    Services in custom ViewModels
    View creation mechanisms
   [Collapse]Predefined Set
    [Expand]Dialog Services
    [Expand]Message Box Services
    [Expand]Document Services
      View Injection Service Concept
      View Injection Manager Concept
      Implementing Custom Strategy
    [Expand]Report Services
    How to create a Custom Service
   Data Annotation Attributes
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


The ViewInjectionService is an IViewInjectionService implementation that allows you to integrate any ViewModel (with its View) to controls.


You are viewing ViewInjectionService documentation. If you're starting a new project, we strongly recommend that you use Module Injection Framework (MIF).

Assume that you have several views with view models (CustomersView/CustomersViewModel, ProductsView/ ProductsViewModel and SalesView/SalesViewModel) that have to be shown in an items control.

To accomplish this task, place the items control (suppose, it's a FlipView control) on the MainView and add the ViewInjectionService to the control's dxmvvm:Interaction.Behaviors collection as usual.

Inject views with view models using the ViewInjectionManager's Inject method (To learn more about concepts of ViewInjectionService and ViewInjectionManager, refer to the View Injection Service Concept and View Injection Manager Concept topics respectively). For example, perform injections in the Startup event handler.

The Regions class is a static class with static string properties.

ModuleType is an enumeration:

The FlipView is populated. Add a navigation view to our MainView.

Inject items to the TileBar

The example application is almost ready. Synchronize the TileBar and FlipView, so they show the same element. To do this, use the RegisterNavigatedEventHandler.

By default, ViewInjectionService supports a fixed number of standard and DevExpress controls. However if necessary, you can extend it to work with your own controls. To learn how to do it, refer to Implementing Custom Strategy.

Expanded Example

Expanded See Also

Is this topic helpful?​​​​​​​