Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text

Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.Editors

Public Class LinkToLookupViewController
    Inherits ViewController(Of ListView)
    Private _LookupEditor As PropertyEditor
    Public Property Lookup() As PropertyEditor
        Get
            Return _LookupEditor
        End Get
        Set(ByVal value As PropertyEditor)
            _LookupEditor = value
        End Set
    End Property
End Class

Public MustInherit Class LookupLinkViewController
    Inherits ViewController(Of DetailView)
    Protected Overrides Sub OnActivated()
        MyBase.OnActivated()
        For Each editor As PropertyEditor In View.GetItems(Of PropertyEditor)()
            AddHandler editor.ControlCreated, AddressOf editor_ControlCreated
        Next editor
    End Sub
    Private Sub editor_ControlCreated(ByVal sender As Object, ByVal e As EventArgs)
        ProcessLookupEditor(CType(sender, PropertyEditor))
    End Sub
    Protected MustOverride Sub ProcessLookupEditor(ByVal editor As PropertyEditor)
End Class
