public object Convert(object value, Type targetType, object parameter, string language) { string encodedGlyph = value.ToString(); string glyph = GlyphEncoder.DecodeGlyph(encodedGlyph, out GlyphFamily family); FontIcon icon = new FontIcon { Glyph = glyph, }; string resourceName = GetFontIconStyleResourceName(family); if (!string.IsNullOrWhiteSpace(resourceName) && ResourceLocator.GetResource(resourceName, out Style fontStyle)) { icon.Style = fontStyle; } if (parameter != null && double.TryParse(parameter.ToString(), out double fontSize)) { icon.FontSize = fontSize; } return(icon); }
public void LoadTestData() { //OneDrive Syncing Files SyncingFiles.Add(new ExtendedBundle("", "DSC1951.jpg", "Uploaded to", "Camera", "", "3h ago")); SyncingFiles.Add(new ExtendedBundle("", "DSC1952.jpg", "Uploaded to", "Camera", "", "3h ago")); SyncingFiles.Add(new ExtendedBundle("", "DSC1953.jpg", "Uploaded to", "Camera", "", "3h ago")); SyncingFiles.Add(new ExtendedBundle("", "Last report.docx", "Uploaded to", "Documents", "", "6h ago")); //Office Files OfficePinnedFiles.Add(new ExtendedBundle("", "Ants report", "OneDrive » Documents » Reports", null, "", null, "WordForeground")); OfficeRecentFiles.Add(new ExtendedBundle("", "Draft for Tuesday", "OneDrive » Documents » Reports", null, null, null, "WordForeground")); OfficeRecentFiles.Add(new ExtendedBundle("", "Numbers to sum", "OneDrive » Documents » Extras", null, "", null, "ExcelForeground")); OfficeRecentFiles.Add(new ExtendedBundle("", "Squares and lines", "OneDrive » Documents » Extras", null, "", null, "ExcelForeground")); OfficeRecentFiles.Add(new ExtendedBundle("", "Mockup Presentation", "OneDrive » Documents » Work", null, "", null, "PowerPointForeground")); //Account notifications AccountNotifications.Add(new ExtendedBundle(GlyphEncoder.EncodeGlyph("", GlyphFamily.FabricMDL2), "New Canary build for", "Edge", "Microsoft Edge Insider", null, "Just now", "EdgeCanaryForeground")); AccountNotifications.Add(new ExtendedBundle(GlyphEncoder.EncodeGlyph("", GlyphFamily.SegoeMDL2), "New Insider build available", "10.0.21200", "Windows Insider Program", null, "Yesterday", "PowerPointForeground")); AccountNotifications.Add(new ExtendedBundle(GlyphEncoder.EncodeGlyph("", GlyphFamily.FabricMDL2), "Monthly recommended apps", "", "Microsoft Store", null, "2d ago", "")); }