MapViewer hosted in a WPF
Application.xaml.vb
' Copyright 2010 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 

Imports System.Windows
Imports ESRI.ArcGIS.esriSystem

Class Application

  Protected Overrides Sub OnStartup(ByVal e As System.Windows.StartupEventArgs)
    MyBase.OnStartup(e)

    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine)
    InitializeEngineLicense()
  End Sub
  

  Public Sub InitializeEngineLicense()

    Dim aoi As AoInitialize = New AoInitializeClass()

    'more license choices could be included here
    Dim productCode As esriLicenseProductCode = esriLicenseProductCode.esriLicenseProductCodeEngine
    If (aoi.IsProductCodeAvailable(productCode) = esriLicenseStatus.esriLicenseAvailable) Then
      aoi.Initialize(productCode)
    End If

  End Sub

End Class