Example #1
0
            public void Bind(ActionId actionId, object control)
            {
                ToolStripSplitButton nativeControl = (ToolStripSplitButton)control;

                nativeControl.ButtonClick += (sender, e) =>
                {
                    ActionManager.Execute(actionId);
                };

                ActionManager.Updating += (s, e) =>
                {
                    nativeControl.Enabled = ActionManager.CanExecute(actionId);
                };
            }
Example #2
0
            public void Bind(ActionId actionId, object control)
            {
                ToolStripMenuItem nativeControl = (ToolStripMenuItem)control;

                nativeControl.Click += (sender, e) =>
                {
                    ActionManager.Execute(actionId);
                };

                ActionManager.Updating += (s, e) =>
                {
                    IAction action = ActionManager.GetAction(actionId);
                    nativeControl.Enabled = ActionManager.CanExecute(actionId);
                    nativeControl.Checked = action.IsChecked;
                };
            }
Example #3
0
            public void Bind(ActionId actionId, object control)
            {
                RibbonToggleButton nativeControl = (RibbonToggleButton)control;

                nativeControl.Click += (sender, e) =>
                {
                    ActionManager.Execute(actionId);
                };

                ActionManager.Updating += (s, e) =>
                {
                    IAction action = ActionManager.GetAction(actionId);
                    nativeControl.Enabled = ActionManager.CanExecute(actionId);
                    nativeControl.Checked = nativeControl.Enabled ? action.IsChecked : false;
                };
            }
Example #4
0
            public void Bind(ActionId actionId, object control)
            {
                if (null == control)
                {
                    throw new ArgumentNullException("control");
                }

                RibbonButton nativeControl = (RibbonButton)control;

                nativeControl.Click += (sender, e) =>
                {
                    ActionManager.Execute(actionId);
                };

                ActionManager.Updating += (s, e) =>
                {
                    nativeControl.Enabled = ActionManager.CanExecute(actionId);
                };
            }