I have implemented two custom themes for use when viewing charts on screen versus printing. Unfortunately, the themes do not contain all necessary color definitions. For example, these are multi-series charts, with each series having a different color. Is there any way to extend the ThemeManager to include these additional required brushes (and of course, be able to bind to those colors from XAML).
Alternatively, if there is a way to bind to existing ThemeManager colors from XAML, i could simply use several existing but otherwise unused ThemeManager brushes for my various series stroke brushes.
Bill
- William Lear asked 7 years ago
- You must login to post comments
it appears ThemeBinding only works for brushes. I would like to use it to bind a FastLineRenderableSeries Stroke to a different color in the theme. Is there a way to bind to a Color in a Theme?
Bill
- William Lear answered 7 years ago
-
Hi William, ThemeBinding should work fine for Colors. It simply creates a binding inside. In fact, we use it to bind default colors from ThemeColorProvider, such as DefaultCandleUpWickColor, DefaultCandleDownWickColor.
- You must login to post comments
Andrew,
Thanks. The ThemeBinding extension looks like what I need. There are several defined but unused brushes I can choose from.
I use ThemeManager to switch between two custom themes – one for screen display and one for export to file, so having all needed brushes managed by ThemeManager simplifies the process.
What namespace are you assuming “me” maps to?
Bill
- William Lear answered 7 years ago
-
xmlns:me is … SciChart.Charting.Common.MarkupExtensions
- You must login to post comments
Hi William
You can find a list of ThemeManager brushes here: IThemeColorProvider interface.
You can bind to a theme brush by using this code:
<!-- Binds to current theme GridBackground Brush -->
<Setter Property="Background" Value="{me:ThemeBinding GridBackgroundBrush}" />
Alternatively, you can simply specify brushes in styles and place the styles inside SciChartSurface.Resources. These will appear in export as well as on screen.
Hope this helps!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 7 years ago
- You must login to post comments
Please login first to submit.