Ejemplo n.º 1
0
        public CustomStackedItem CreateSplitButton(CustomPanel panel, string name, string text, Action <CustomSplitButton> action)
        {
            var spl = new CustomSplitButton(panel, name, text);

            action?.Invoke(spl);
            Items.Add(spl);
            return(this);
        }
Ejemplo n.º 2
0
        public CustomPanel CreateSplitButton(string name, string text, Action <CustomSplitButton> action)
        {
            var splitButton = new CustomSplitButton(name, text);

            action?.Invoke(splitButton);
            var splitButtonData = splitButton.GetButtonData();

            ConvertToSpliButton = _panel.AddItem(splitButtonData) as SplitButton;
            splitButton.BuildButtons(ConvertToSpliButton);
            splitButton.RibbonItem = ConvertToSpliButton;
            return(this);
        }
Ejemplo n.º 3
0
        public CustomPanel CreateSplitButton(string name, string text, Action <CustomStackedItem> itemsAction)
        {
            var buttonControl = new CustomSplitButton(this, name, text);

            var splitButton = buttonControl.Create();

            var stackedItem = new CustomStackedItem(this);

            itemsAction.Invoke(stackedItem);

            var pushButtons = stackedItem
                              .Items
                              .Select(x => x.GetItemData())
                              .Cast <PushButtonData>()
                              .Select(x => splitButton.AddPushButton(x))
                              .ToList();

            splitButton.CurrentButton = pushButtons[stackedItem.GetDefaultButtonIndex()];

            return(this);
        }