Imports System.Linq
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Win.Layout
Imports DevExpress.ExpressApp.Model
Imports DevExpress.XtraEditors

Partial Public Class SplitterVC
    Inherits ViewController(Of ListView)
    Public Sub New()
        InitializeComponent()
    End Sub
    Protected Overrides Sub OnActivated()
        MyBase.OnActivated()
        If View.Model.MasterDetailMode = MasterDetailMode.ListViewAndDetailView Then
            AddHandler View.ControlsCreated, AddressOf View_ControlCreated
        End If
    End Sub
    Protected Overrides Sub OnViewControlsCreated()
        MyBase.OnViewControlsCreated()
    End Sub
    Protected Overrides Sub OnDeactivated()
        MyBase.OnDeactivated()
    End Sub

    Private Sub View_ControlCreated(sender As Object, e As EventArgs)
        Dim splitContainer As SplitContainer = CType(View.Control, SplitContainer)
        splitContainer.FixedPanel = SplitFixedPanel.None
        splitContainer.SplitterPosition = TryCast(View.Model.SplitLayout, IModelListViewSplitLayout).SplitterPosition
    End Sub
End Class
