Exemplo n.º 1
0
        private static Link SelectedLink(ModernMenu menu)
        {
            var target = menu.GetNavigationTarget();

            if (target == null)
            {
                return(null);
            }
            return(menu.SelectedLinkGroup.Links.Items.OfType <Link>()
                   .FirstOrDefault(x => x.Source == target.CurrentSource));
        }
Exemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     this.Loaded += (s, e) =>
     {
         ModernMenu mm = FindVisualChildren <ModernMenu>(this).FirstOrDefault();
         if (mm != null)
         {
             ListBox lb = FindVisualChildren <ListBox>(mm)?.ElementAt(1);
             if (lb != null)
             {
                 ListBoxItem link = FindVisualChildren <ListBoxItem>(lb).FirstOrDefault(x => x.Content == theLink);
                 if (link != null)
                 {
                     link.IsEnabled = false;
                 }
             }
         }
     };
 }