Unplanned
Last Updated: 23 Jul 2019 06:50 by ADMIN
Geoffrey
Created on: 23 Jul 2019 06:49
Category: PersistenceFramework
Type: Bug Report
1
StackOverflow exception when saving RichTexBox and RichTextBoxUI is referenced in the project

 

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));

0 comments