Hi,
I’m attempting to bind a FontImageSource to the ImageSource property of an SfChip via a model class. However, when using data binding for the Glyph, FontFamily, etc., my app becomes unresponsive and hangs (tested on MacCatalyst using .NET MAUI).
After extensive troubleshooting, I confirmed that:
Using a static FontImageSource directly in XAML works.
Binding the same FontGlyph to a Label inside the same template works.
But binding FontImageSource dynamically to SfChip.ImageSource causes a hang.
Here’s the model class I’m binding to:
public class DeviceSortOrderItem
{
public DeviceSortOption SortOrder { get; set; }
public string DisplayName { get; set; } = string.Empty;
// Bound to FontImageSource
public string FontGlyph { get; set; } = "\ue5db";
public string FontFamily { get; set; } = "MaterialIcons";
public double FontSize { get; set; } = 16;
public Color FontColor { get; set; } = Colors.Black;
}
And here’s the relevant XAML:
<chip:SfChip Text="{Binding DisplayName}" ShowIcon="True">
<chip:SfChip.ImageSource>
<FontImageSource Glyph="{Binding FontGlyph}"
FontFamily="{Binding FontFamily}"
Size="{Binding FontSize}"
Color="{Binding FontColor}" />
</chip:SfChip.ImageSource>
</chip:SfChip>
As a workaround, I’m using DataTrigger to swap in static icons based on logic — which does work.
Is this a known issue, or is there a recommended way to safely bind FontImageSource inside SfChipGroup.ItemTemplate?
Thanks in advance!
Best regards,
Sindre