BetterExplorer.CustomizeQAT.RefreshQATDialog C# (CSharp) Method

RefreshQATDialog() private method

private RefreshQATDialog ( Ribbon ribbon ) : void
ribbon Fluent.Ribbon
return void
		private void RefreshQATDialog(Ribbon ribbon) {
			List<IRibbonControl> NonQATButtons = (from Tab in ribbon.Tabs
												  from Group in Tab.Groups
												  from Item in Group.Items.OfType<IRibbonControl>()
												  where !(ribbon.IsInQuickAccessToolBar(Item as UIElement))
												  orderby Item.Header
												  select Item).ToList();

			foreach (IRibbonControl item in NonQATButtons) {
				AllControls.Items.Add(GetRibbonItemListDisplay(item));
			}

			#region DO NOT DELETE (yet) [From: Aaron Campf]
			var AllMenuItems = MainForm.TheRibbon.QuickAccessItems.Select(x => x.Target).ToList();
			var Controls = (from control in MainForm.TheRibbon.QuickAccessItems
							select control as Control into newControl
							where !AllMenuItems.Any(x => x.Name == newControl.Name)
							select newControl).ToList();
			#endregion

			AllMenuItems.AddRange(Controls);
			//Here add visible elements since we want to show in that dialog only visible elements into the QAT.
			//Maybe have to find a way to show all elements even not visible and do some handling to display them properly
			foreach (var item in MainForm.TheRibbon.QuickAccessItems.Cast<IRibbonControl>()) {
				QATControls.Items.Add(GetRibbonItemListDisplay(item));
			}
		}

Usage Example

        public static void Open(MainWindow mainWindow, Ribbon ribbon)
        {
            var qal = new CustomizeQAT();

            qal.Owner    = mainWindow;
            qal.MainForm = mainWindow;
            qal.RefreshQATDialog(ribbon);
            qal.ShowDialog();
        }
All Usage Examples Of BetterExplorer.CustomizeQAT::RefreshQATDialog