I need to ad an icon which represents a file type in each row of the WinUI DataGrid. Here is what i did in order to implement this functionality:
<controls:DataGridTemplateColumn Tag="Icon_Col">
<controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate> <Image x:Name="img" Source="{Binding FileTypeIcon}" Height="32" Width="32" />
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
The object FileTypeIcon has been initialized as
directoryContent.FileTypeIcon = System.Drawing.Icon.ExtractAssociatedIcon(fileInfo.FullName);
All works good except the Icon doesn't show up. I check in debuger the object it self has been properly initialized it is just XAML won't show it...
COuld you please explain what else needs to be done in order to show icon ?
Thanks in advance, Best regards, Maks.