IocExtension.Type Property
Gets or sets the type of the object or service that the IocExtension resolves from the configured dependency injection container.
Namespace: DevExpress.Mvvm.UI
Assembly: DevExpress.Xpf.Core.v26.1.dll
Declaration
Property Value
| Type | Description |
|---|---|
| Type | The type of the object or service that the IocExtension resolves from the configured dependency injection container. |
Remarks
The following code snippet uses the IocExtension to resolve a MainViewModel from the configured dependency injection container. The window sets the resolved MainViewModel instance as DataContext, so the TextBlock can bind to the Message property:
<dx:ThemedWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:vm="clr-namespace:MvvmApp.ViewModels"
DataContext="{dxmvvm:Ioc Type={x:Type vm:MainViewModel}}">
<Grid>
<TextBlock Text="{Binding Message}"/>
</Grid>
</dx:ThemedWindow>
See Also