Exemplo n.º 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);
                };
            }
Exemplo n.º 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;
                };
            }
Exemplo n.º 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;
                };
            }
Exemplo n.º 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);
                };
            }