I need to display all the user s installed fonts in a WinUI 3 ComboBox
. I m using this code:
<ComboBox x:Name="FontComboBox" ItemsSource="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Source}" FontFamily="{Binding Source}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
But this causes the error:
The type x:Static was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
Not sure what an assembly reference is.
What would I do to fix this?