SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
I get the following exception:
{System.InvalidOperationException: Cannot set a property on object ‘System.Windows.Media.LinearGradientBrush’ because it is in a read-only state.
Other themes print fine, like BrightSpark. I guess Chrome has a problem because of its gradient background. I plan on using BrightSpark, so this is not a problem for me.
Here is the code I used:
private void PrintMenuItem_Click(object sender, RoutedEventArgs e)
{
var dialog = new PrintDialog();
if (dialog.ShowDialog() == true)
{
dialog.PrintVisual(FormationChart, "Formation Chart");
}
}
Hi there,
Thank you for reporting this issue. I logged it and we will investigate and try to fix.
At first sight, it looks like occurring when something tries to change properties of a sealed brush. Actually, you could workaround this by setting SciChartSurface.Background to a SolidBrush instead of the default GradientBrush, or use another theme (as you suggested).
Best regards,
Yuriy
Hello,
Has this issue been resolved? One of our users fired a print and it brought the whole application down.
Thanks,
-Thomas
@Thomas who commented on this issue today. I just did some testing with SciChart v4.2.3.
Steps to reproduce:
1.) Start SciChart WPF v4.2.3 Examples
2.) Search and open the ‘Export and Screenshot Options in Chart’
3.) Select Settings -> Enable Dev Mode
4.) Back in the example, change the theme to Chrome
5.) Hit the Print button
It seems to export without exception.
Best regards,
Andrew
Please login first to submit.