Пример #1
0
        public ConnectorButton(Button button, ViewModelCommandBase command)
        {
            button.Click += (sender, args) =>
            {
                command.Execute(null);
            };

            button.Enabled             = command.CanExecute(null);
            command.CanExecuteChanged += (sender, args) =>
            {
                button.Enabled = command.Enabled;
            };
        }
Пример #2
0
        public ConnectorUIButton(UIButton button, ViewModelCommandBase command)
        {
            button.TouchUpInside += (sender, args) =>
            {
                command.Execute(null);
            };

            command.CanExecuteChanged += (sender, args) =>
            {
                button.Enabled = command.Enabled;
            };

            button.Enabled = command.Enabled;
        }