private static ImageSource GetApplicationIcon(string path) { if (!string.IsNullOrWhiteSpace(path)) { IconExtractor iconExtractor = new IconExtractor(path); // If any icon is found if (iconExtractor.Count > 0) { // Gets the largest icon from the exe return(iconExtractor.GetIcon(0).ToImageSource()); } } return(IconUtil.ToImageSource(SystemIcons.Application)); }