0

Trying to rename the display name of a link group to change depending on the user's login details.

Anyone know if it's possible to rename the display name (profile) once it has been defined?

XAML :

<mui:LinkGroup DisplayName="Profile" GroupKey="Profile">
            <mui:LinkGroup.Links>
                <mui:Link DisplayName="Teams" Source="/Pages/Teams.xaml" />
                <mui:Link DisplayName="Tasks" Source="Pages/Tasks.xaml"/>
            </mui:LinkGroup.Links>
</mui:LinkGroup>
Machavity
  • 30,841
  • 27
  • 92
  • 100
Dan
  • 31
  • 3

1 Answers1

0

Get a reference to the ModernWindow the linkgroup is on, find the LinkGroup with the DisplayName and change it.

Here is some code using the demo app that comes with ModernUI to change the 'Welcome' LinkGroup:

var mw = Application.Current.MainWindow as FirstFloor.ModernUI.Windows.Controls.ModernWindow;
var lg = mw.MenuLinkGroups.Where(aa => aa.DisplayName == "Welcome").FirstOrDefault();
if (lg != null)
    lg.DisplayName = "Welcome to the Jungle";
J.H.
  • 4,232
  • 1
  • 18
  • 16