RadRichTextBox (RTB) is used in MainWindow and no other controls are used.
Saving the RTB with PersistenceFramework results in endless loop of saving RTB dialogs and its template parts.
This results in StackoverflowException.
EDIT:
Option 1 for workaround
<
telerik:RadRichTextBox
x:Name
=
"rtb"
>
<
telerik:PersistenceManager.SerializationOptions
>
<
telerik:SerializationMetadataCollection
>
<
telerik:PropertyNameMetadata
Condition
=
"Except"
Expression
=
"Dialog"
SearchType
=
"PropertyName"
/>
</
telerik:SerializationMetadataCollection
>
</
telerik:PersistenceManager.SerializationOptions
>
</
telerik:RadRichTextBox
>
Option 2 for workaround
PersistenceManager manager = new PersistenceManager();
manager.PropertyPersisting += (o, ea)=>
{
if (!string.IsNullOrEmpty(ea.Name))
{
if (ea.Name.Contains("Dialog"))
{
ea.Cancel = true;
}
}
};
IsolatedStorageProvider isoProvider = new IsolatedStorageProvider(manager);
isoProvider.SaveToStorage(PersistenceManager.GetStorageId(this.rtb));