I'm trying to change the background of an xamSpreadsheet to have some kind of "dark" theme.
Setting the Spreadsheet.Workbook.Background or Foreground seems to have no effect.
How can I change the default background/foreground color for cells ?
Do I have to create a new theme just to change these colors ?
I have been investigating into the behavior you are seeing, and the XamSpreadsheet’s Background and Foreground properties are not having any effect because the “data area” of the XamSpreadsheet is actually determined by the Workbook, and not those properties.
For example, if you set the Workbook.Styles.NormalStyle.StyleFormat.Fill property to be Black via CellFill.CreateSolidFill(Colors.Black), this would work to color the data area of the spreadsheet. There are a bunch of other properties off of NormalStyle.StyleFormat as well that can help you to create a “theme” for your XamSpreadsheet data area.
It is worth noting that Excel works in the same way, so if you change this on the Workbook that you are loading to the XamSpreadsheet and then save it out to Excel, it will show up in Excel in the same way that it does in the XamSpreadsheet.
I am attaching a sample project that demonstrates the above. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Thank you, this is exactly what I was looking for