Hello,
Welcome to our Microsoft Q&A platform!
To set data binding in csharp, try using the BindableObjectExtensions.SetBinding
method.
Check the code:
var iconSource = new FontImageSource
{
Size = ICON_SIZE,
FontFamily = "ionicons
};
iconSource.SetBinding(FontImageSource.GlyphProperty, "name");
iconSource.SetBinding(FontImageSource.ColorProperty, "name");
var imageButton = new ImageButton { Source = iconSource };
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.