Xamarin.Forms Content of a button

后端 未结 6 1034
我寻月下人不归
我寻月下人不归 2021-02-15 16:13

I\'m trying to add a custom content to a button in Xamarin Forms.

By default Button is created like this:

6条回答
  •  被撕碎了的回忆
    2021-02-15 16:54

    Thanks Tomasz for creating ContentButton.

    I have used it successfully, adding a CommandParameter in a similar way:

    
        
    
    
    public static readonly BindableProperty CommandParameterProperty =
        BindableProperty.Create(nameof(CommandParameter), typeof(object), typeof(ContentButton));
    
    public object CommandParameter
    {
        get { return (object)GetValue(CommandParameterProperty); }
        set { SetValue(CommandParameterProperty, value); }
    }
    

提交回复
热议问题