This project is read-only.

[Solved] LinkGroupCollection and MVVM

Sep 20, 2013 at 5:22 PM
Edited Sep 20, 2013 at 6:04 PM

I hope someone can help me. I using MUI at firsttime and so I need some basic help.

I have create a LinkGroupCollection Property in my ViewModel.

Public Property MenuLinkGroups As FirstFloor.ModernUI.Presentation.LinkGroupCollection
        Set(value As FirstFloor.ModernUI.Presentation.LinkGroupCollection)
            If value IsNot _MenuLinkGroups Then
                _MenuLinkGroups = value
            End If
        End Set
            Return _MenuLinkGroups
        End Get
    End Property
    Private _MenuLinkGroups As FirstFloor.ModernUI.Presentation.LinkGroupCollection

Public Function GetMuiMenuLinkGroups() As FirstFloor.ModernUI.Presentation.LinkGroupCollection

        Dim _muiMenu As New FirstFloor.ModernUI.Presentation.LinkGroupCollection
        Dim _newMuiGroup As FirstFloor.ModernUI.Presentation.LinkGroup
        Dim _newMuiLink As FirstFloor.ModernUI.Presentation.Link

        For Each mnuGroup As Entities.MenuGroup In OlbSections

            _newMuiGroup = New FirstFloor.ModernUI.Presentation.LinkGroup
            With _newMuiGroup
                .DisplayName = mnuGroup.Name
                .GroupName = mnuGroup.Name
            End With

            For Each mnuEntry As Entities.MenuEntry In mnuGroup.MenuEntries

                _newMuiLink = New FirstFloor.ModernUI.Presentation.Link
                With _newMuiLink
                    .DisplayName = mnuEntry.Text
                    .Source = New Uri("/Pages/MUIPages.xaml", UriKind.Relative)
                End With





        Return _muiMenu

    End Function
In my XAML I have following code
<mui:ModernWindow x:Class="ClientMUIView"

    Title="ClientMUIView" Height="500" Width="800"
    MenuLinkGroups="{Binding MenuLinkGroups}">
My Problem is: Only one LinkGroup is be showen - but 5 LinkGroups are in the MenuLinkGroups-Property. What are my misstake?

Solution: I have different .GroupNames - if they all the same, than it works