Exemple #1
0
        protected override void CreateRibbonCommand(IRibbonCommands cmds)
        {
            cmds.AddButtonCommand(ButtonMore).Action(() => MessageBox.Show(@"More..."));
            cmds.AddButtonCommand(HappyButtonId).Action(() => MessageBox.Show("Be Happy !!!"));

            cmds.AddCheckBoxCommand(ShowNumberId).Action(isPressed =>
            {
                checkboxPressed = isPressed;
                Ribbon.InvalidateControl(DynamicGalleryId);
                MessageBox.Show(isPressed ? "Show number pressed" : "Show number NOT pressed");
            });

            cmds.AddGalleryCommand(GalleryId).Action(position =>
            {
                switch (position)
                {
                case 0:
                    MessageBox.Show("Option: Show number Clicked");
                    return;

                case 1:
                    MessageBox.Show("Option: Be Happy !!!");
                    return;
                }
            });

            cmds.AddGalleryCommand(DynamicGalleryId)
            .IsEnabled(() => checkboxPressed)
            .ItemCounts(content.Count)
            .ItemsId(content.Ids)
            .ItemsLabel(content.Labels)
            .ItemsImage(() => content.Images())
            .ItemsSupertip(content.SuperTips)
            .ItemSelectionIndex(() => GallerySelectedIndex)
            .Action(i =>
            {
                GallerySelectedIndex = i;
                MessageBox.Show(@"Your selection: " + (i + 1));
            });
        }
Exemple #2
0
        protected override void CreateRibbonCommand(IRibbonCommands cmds)
        {
            cmds.AddButtonCommand(ButtonMore).Action(() => MessageBox.Show(@"More..."));
            cmds.AddButtonCommand(HappyButtonId).Action(() => MessageBox.Show("Be Happy !!!"));

            cmds.AddCheckBoxCommand(ShowNumberId).Action(isPressed =>
            {
                checkboxPressed = isPressed;
                Ribbon.InvalidateControl(DynamicGalleryId);
                MessageBox.Show(isPressed ? "Show number pressed" : "Show number NOT pressed");
            });

            cmds.AddGalleryCommand(GalleryId).Action(position =>
            {
                switch (position)
                {
                    case 0:
                        MessageBox.Show("Option: Show number Clicked");
                        return;
                    case 1:
                        MessageBox.Show("Option: Be Happy !!!");
                        return;
                }
            });

            cmds.AddGalleryCommand(DynamicGalleryId)
                .IsEnabled(()=>checkboxPressed)
                .ItemCounts(content.Count)
                .ItemsId(content.Ids)
                .ItemsLabel(content.Labels)
                .ItemsImage(() => content.Images())
                .ItemsSupertip(content.SuperTips)
                .ItemSelectionIndex(() => GallerySelectedIndex)
                .Action(i =>
                {
                    GallerySelectedIndex = i;
                    MessageBox.Show(@"Your selection: " + (i+1));
                });
        }