Ejemplo n.º 1
0
        /// <summary>
        /// Creates the button without command binding.
        /// </summary>
        /// <param name="itemsControl">The items control.</param>
        /// <param name="items">The nested items.</param>
        /// <param name="header">The header.</param>
        /// <param name="icon">The icon.</param>
        /// <param name="largeIcon">The large icon.</param>
        /// <returns>Split button.</returns>
        /// <exception cref="ArgumentNullException">The <paramref header="itemsControl"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">The <paramref header="header"/> is <c>null</c> or whitespace.</exception>
        private static SplitButton CreateSplitButtonWithoutCommandBinding(this ItemsControl itemsControl, List <IRibbonItem> items, string header, string icon, string largeIcon)
        {
            Argument.IsNotNull("itemsControl", itemsControl);
            Argument.IsNotNullOrWhitespace("header", header);

            var button = new SplitButton();

            button.Header    = header;
            button.Icon      = icon;
            button.LargeIcon = largeIcon;

            foreach (var ribbonItem in items)
            {
                button.AddRibbonItem(ribbonItem);
            }

            itemsControl.Items.Add(button);

            return(button);
        }