Determines if chart properties marked for serialization are reset to their default values before serialized data is loaded.
Indicates that object properties are reset to default values before loading.
Visual Basic (Declaration) | |
---|---|
Public Property ResetWhenLoading As Boolean |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public bool ResetWhenLoading {get; set;} |
Return Value
If True then serializable properties (specified by the Content, SerializableContent and NonSerializableContent properties) are reset to their default values when the Load method is called. If False they are not reset. Defaults to True.
The following example first serializes all appearance data to disk (only properties with non-default values), then loads the appearance data without resetting the chart's properties to their defaults. Axis labels are also serialized.
Visual Basic | Copy Code |
---|---|
' Save chart appearance properties that have non-default values., as well as axis labels. |
C# | Copy Code |
---|---|
// Save chart appearance properties that have non-default values, as well as axis labels. |
When chart data is serialized only properties that do not have default values are persisted (this reduces the amount of saved data). Therefore it is possible for a serializable property to not be saved, and during a load operation by default this property will be reset to its default value. If it is possible that a serializable property is set to a non-default value after data is saved then set this property to False so that the default value will not overwrite the non-default value.
Properties of a chart can be reset at any time using the Reset method.
Please note that care must be taken when resetting collection properties. If "Chart.Series" or "Chart.ChartAreas" have been set as specific items to be persisted then resetting the chart (i.e. ResetWhenLoading is True) will result in all Series or ChartArea items to be deleted from the chart when the data is saved and then loaded. This means that all data points in the chart series will be lost.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family