void TouchDown() { TouchedDown?.Invoke(this, null); TouchedDownCommand?.Execute(null); Container.BackgroundColor = HighlightBackgroundColor; ButtonText.TextColor = HighlightForegroundColor; ColorIcon(HighlightForegroundColor); }
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; } }