'read-only state' error
Posted: Mon Jun 24, 2019 9:35 am
Hi,
I'm having a problem with an 'InvalidOperationException' with the message 'Cannot set a property on object '' because it is in a read-only state.' on a WPF window.
It's difficult to figure out exactly what's causing it, in my own code it's simply a property notifying of a change that looks from the stack trace to be updating bindings, ultimately reaching the 'LightningChartUltimate.TitleChanged' handler, and within the 'ChartTitle.CreateShadow' method, it sets the current value of a property which throws the exception. The title of the text IS bound to a property on the DataContext, but the shadow is not, it's just transparent. The property in my code that's being updated IS the one the DataContext is bound to- basically it's a 'ChartViewModel' that implements INotifyPropertyChanged and has a property called 'Title', that the chart title is bound to. It's on replacing the 'ChartViewModel' instance that I hit this error.
I'm using the SemibindableCharting library.
At the point where it does this, it's replacing an existing DataContext, when it first sets an initial one, it works just fine.
Any idea what circumstances might cause this error?
Regards,
Ali
I'm having a problem with an 'InvalidOperationException' with the message 'Cannot set a property on object '' because it is in a read-only state.' on a WPF window.
It's difficult to figure out exactly what's causing it, in my own code it's simply a property notifying of a change that looks from the stack trace to be updating bindings, ultimately reaching the 'LightningChartUltimate.TitleChanged' handler, and within the 'ChartTitle.CreateShadow' method, it sets the current value of a property which throws the exception. The title of the text IS bound to a property on the DataContext, but the shadow is not, it's just transparent. The property in my code that's being updated IS the one the DataContext is bound to- basically it's a 'ChartViewModel' that implements INotifyPropertyChanged and has a property called 'Title', that the chart title is bound to. It's on replacing the 'ChartViewModel' instance that I hit this error.
I'm using the SemibindableCharting library.
At the point where it does this, it's replacing an existing DataContext, when it first sets an initial one, it works just fine.
Any idea what circumstances might cause this error?
Regards,
Ali