/// <summary> /// Gets the System Fonts to build the collection. /// </summary> private void InitializeFontFamilyList() { ICollection <FontFamily> familyCollection = Fonts.SystemFontFamilies; if (familyCollection != null) { FontFamilyListItem[] items = new FontFamilyListItem[familyCollection.Count]; int i = 0; foreach (FontFamily family in familyCollection) { items[i++] = new FontFamilyListItem(family); } Array.Sort <FontFamilyListItem>(items); FontFamilyCollection = new Collection <FontFamilyListItem>(items); SelectedFontFamily = FontFamilyCollection.FirstOrDefault(); } }
/// <summary> /// Gets the System Fonts to build the collection. /// </summary> private void InitializeFontFamilyList() { ICollection<FontFamily> familyCollection = Fonts.SystemFontFamilies; if (familyCollection != null) { FontFamilyListItem[] items = new FontFamilyListItem[familyCollection.Count]; int i = 0; foreach (FontFamily family in familyCollection) { items[i++] = new FontFamilyListItem(family); } Array.Sort<FontFamilyListItem>(items); FontFamilyCollection = new Collection<FontFamilyListItem>(items); SelectedFontFamily = FontFamilyCollection.FirstOrDefault(); } }