We a building an add-on and have been very careful to ensure that all our panels and windows are compatible with skins, by inheriting our styles we bind to our WPF elements from styles in the BluePrint.xaml.
We are now wanting to write some text in an indicator. The biggest issue we have with skin compatibly here is text color. If the text is the same or close to the same color as the skins chart background color, it is either impossible or very difficult to see.
We have used the RenderTarget.DrawTextLayout method to write the text on the chart from the indicator, passing it a SharpDX.DirectWrite.TextLayout, and SharpDX.Direct2D1.Brush objects.
The text color is set by the SharpDX.Color object that gets passed to the SharpDX.Direct2D1.Brush.
The only way I can see to make this compatible with skins at the moment is to somehow get/create a reference to an instance of the FontLabelBrush from the BluePrint.xaml and access it's Color values and use then to create a SharpDX.Color object of the same color.
Questions:
- Is this the best way to write skin compatible text on the chart, or is there an easier way to do it?
- Do you have a code sample of how to do this?
Thanks for your time.
Comment