Xamarin.Forms Content of a button

后端 未结 6 1058
我寻月下人不归
我寻月下人不归 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:56

    Unfortunately, at the moment Xamarin.Forms does not support a Content property for the Button.

    You would have to create your own User Control with a combination of other controls to try and recreate a Button control. You could then make part of your User Control a ContentView, create a BindableProperty to bind your Grid to, then use the a BindingPropertyChangedDelegate to assign the Content property of your ContentView.

提交回复
热议问题