// Set the header to the command text if no header has been explicitly specified

        /*private static object CoerceContent(DependencyObject d, object value) {
         *      CommandButton button = (CommandButton) d;
         *      RelayUICommand uiCommand;
         *
         *      // If no header has been set, use the command's text
         *      if (button.IsValueUnsetAndNull(ContentProperty) && button.Command is RelayUICommand uiCommand) {
         *              value = uiCommand.Text;
         *      }
         *
         *      return value;
         * }*/


        // Set the icon to the command text if no icon has been explicitly specified
        private static object CoerceSource(DependencyObject d, object value)
        {
            CommandButton button = (CommandButton)d;

            // If no icon has been set, use the command's icon
            if (button.IsValueUnsetAndNull(SourceProperty, value) && button.Command is IRelayUICommand uiCommand)
            {
                value = uiCommand.Icon;
            }
            return(value);
        }
        // Gets the input gesture text from the command text if it hasn't been explicitly specified
        private static object CoerceToolTip(DependencyObject d, object value)
        {
            CommandButton button = (CommandButton)d;

            if (button.IsValueUnsetAndNull(ToolTipProperty, value) && button.Command is IRelayUICommand uiCommand)
            {
                string tooltip = "";
                if (!string.IsNullOrEmpty(uiCommand.Text))
                {
                    tooltip += uiCommand.Text;
                }
                if (uiCommand.InputGesture != null)
                {
                    if (!string.IsNullOrEmpty(tooltip))
                    {
                        tooltip += " ";
                    }
                    tooltip += $"({uiCommand.InputGesture.GetDisplayStringForCulture(CultureInfo.CurrentCulture)})";
                }
                return(tooltip);
            }

            return(value);
        }