示例#1
0
        void TouchDown()
        {
            TouchedDown?.Invoke(this, null);
            TouchedDownCommand?.Execute(null);

            Container.BackgroundColor = HighlightBackgroundColor;
            ButtonText.TextColor      = HighlightForegroundColor;
            ColorIcon(HighlightForegroundColor);
        }
示例#2
0
        void CommandCanExecuteChanged(object sender, EventArgs e)
        {
            // Define IsEnabled state
            var canExecuteClick       = ClickedCommand?.CanExecute(null);
            var canExecuteTouchedDown = TouchedDownCommand?.CanExecute(null);

            if (canExecuteClick != null && canExecuteTouchedDown != null)
            {
                IsEnabled = canExecuteClick == true && canExecuteTouchedDown == true;
            }
            else
            {
                IsEnabled = canExecuteClick == true || canExecuteTouchedDown == true;
            }
        }