protected virtual void FillItem(RibbonItemData item) { item.Name = Name; item.Access = Access?.Select(s => s.Access).ToList(); item.Description = Description; item.IsTest = IsTest; var imgName = RibbonGroupData.GetImageName(item.Name); RibbonGroupData.SaveImage(Image, imgName, RibbonVM.userGroup); }
private void SaveImage(IPaletteCommand com) { if (com.Name.IsNullOrEmpty()) { return; } var imageName = RibbonGroupData.GetImageName(com.Name); var file = Path.Combine(imagesDir, imageName); var fi = new FileInfo(file); using (var fileStream = fi.Create()) { var encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create((BitmapSource)com.Image)); encoder.Save(fileStream); } }