Ejemplo n.º 1
0
 private void AddButton(IBaseCommand command, IList itemCollection, RibbonControlSize size = RibbonControlSize.Large)
 {
     if (command != null && itemCollection != null)
     {
         var item = command.ToFluentButton(size);
         if (item != null)
         {
             itemCollection.Add(item);
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取快速访问菜单按钮
        /// </summary>
        /// <param name="command">命令</param>
        /// <param name="size">尺寸</param>
        /// <returns>快速访问菜单按钮</returns>
        public static QuickAccessMenuItem ToQuickAccessMenuItem(this IBaseCommand command, RibbonControlSize size = RibbonControlSize.Large)
        {
            QuickAccessMenuItem item = null;

            if (command != null)
            {
                item = new QuickAccessMenuItem()
                {
                    IsChecked = true,
                    Icon      = command.Icon,
                    Target    = command.ToFluentButton(size, false)
                };
            }
            return(item);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取快速访问菜单按钮
        /// </summary>
        /// <param name="command">命令</param>
        /// <param name="size">尺寸</param>
        /// <returns>快速访问菜单按钮</returns>
        public static BackstageTabItem ToBackstageTabItem(this IBaseCommand command, RibbonControlSize size = RibbonControlSize.Large)
        {
            BackstageTabItem item = null;

            if (command != null)
            {
                item = new BackstageTabItem()
                {
                    Header  = command.Header,
                    Icon    = command.Icon,
                    Content = command.ToFluentButton(size, false)
                };
            }
            return(item);
        }