How to bind links to TitleLinks using viewModel

Aug 23, 2014 at 10:32 AM
Edited Aug 23, 2014 at 10:37 AM
How can we bind link group to TitleLinks in modern ui
<mui:ModernWindow 
        MenuLinkGroups="{Binding MenuLinkGroups}"
        TitleLinks="{Binding TitleLinkGroup}">
</mui:ModernWindow>
and view model contains
private LinkGroupCollection _menuLinkGroups;
        public LinkGroupCollection MenuLinkGroups
        {
            get { return _menuLinkGroups; }
            private set
            {
                _menuLinkGroups = value;
                RaisePropertyChanged("MenuLinkGroups");
            }
        }

        private LinkGroup _titleLinkGroup;
        public LinkGroup TitleLinkGroup
        {
            get { return _titleLinkGroup; }
            set
            {
                _titleLinkGroup = value;
                RaisePropertyChanged("TitleLinkGroup");
            }
        }
and i am setting menu items dynamically after logged in successfully.
LinkGroup salesGroup = new LinkGroup { GroupName = "SalesGroup", DisplayName = "Sales" };
Link cacheRegister = new Link { DisplayName = "Cache Register", Source = new Uri(@"/Pages/Sales/Sales.xaml", UriKind.Relative) };
salesGroup.Links.Add(cacheRegister);
this.MenuLinkGroups.Add(salesGroup);

Link settings = new Link { DisplayName = "Settings", Source = new Uri(@"/Pages/Settings.xaml", UriKind.Relative) };
this.TitleLinkGroup.Links.Add(settings);
Menu link group is binding correctly but Title Links are blank area.
Did i do something wrong... it's great someone can help.
Coordinator
Aug 23, 2014 at 1:39 PM
ModernWindow.TitleLinks is of type LinkCollection, not LinkGroup
Aug 23, 2014 at 5:32 PM
yeah it worked thanks very much.
Feb 20, 2015 at 2:06 PM
Any guidance on how to bind from POCOs, by chance? It would be nice to provide a datatemplate of some sort that converts a POCO/model to a Link.