Skip to main content
A newer version of this page is available.

How to build dock UI according to MVVM pattern using IMVVMDockingProperties interface

  • 4 minutes to read

This example demonstrates how to build a dock UI according to the MVVM design pattern by implementing the IMVVMDockingProperties interface. This interface provides you a way to specify target groups for each of your view models.

More information on this approach can be found at: MVVM Support - Building Dock UI

Another approach to building a dock UI according to the MVVM design pattern is shown in the example: How to: Build Dock UI According to MVVM Pattern Using LayoutAdapter

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports DevExpress.Xpf.Docking

Namespace WpfApplication
    Public Class DocumentViewModel
        Implements IMVVMDockingProperties


        Public Sub New(ByVal caption As String, ByVal imagePath As String)
            Caption = caption
            Glyph = GlyphHelper.GetGlyph(imagePath)
            Text = String.Format("Document text ({0})", caption)
        End Sub

        Private Property TargetName() As String Implements IMVVMDockingProperties.TargetName
            Get
                Return "DocumentsGroup"
            End Get
            Set(ByVal value As String)
                Throw New NotImplementedException()
            End Set

        End Property




        Private privateCaption As String
        Public Property Caption() As String
            Get
                Return privateCaption
            End Get
            Set(ByVal value As String)
                privateCaption = value
            End Set
        End Property


        Private privateGlyph As Object
        Public Property Glyph() As Object
            Get
                Return privateGlyph
            End Get
            Set(ByVal value As Object)
                privateGlyph = value
            End Set
        End Property

        Private privateText As String
        Public Property Text() As String
            Get
                Return privateText
            End Get
            Set(ByVal value As String)
                privateText = value
            End Set
        End Property


    End Class
End Namespace