This is a migrated thread and some comments may be shown as answers.

Getting Error "The type initializer for 'Telerik.Windows.Persistence.PersistenceManager' threw an exception."

1 Answer 96 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Vivek
Top achievements
Rank 1
Vivek asked on 09 Aug 2011, 08:46 PM
Hi Team,


I am very new for this control. here is my scenario.


I have viewer and I am adding a image in the canvas and showing to the user, now user have all options e.g user can rotate the image, they can zoom the image and they can pan the image after the zoom, I need to save this  user state, Now user can go to the print preview click where user will get the original image not the zoomed one, now If user will close the print preview I want to show the user the same zoomin postion and pan postion where he left the image.


I tired with first look example but its not working. 

if (!PrintPreviewClick)
           {
               SaveState();
           }
 
bool PrintPreviewClick = false;
       System.IO.Stream stream;
       private void SaveState()
       {
           IsolatedStorageProvider isoStorageProvider = new IsolatedStorageProvider();
           isoStorageProvider.SaveToStorage();
 
 
       }
 
 /// <summary>
       /// Reset the Print page, clear down all the watermark, border, header,footer
       /// </summary>
       public void ResetPrintPage()
       {
           PrintPreviewClick = false;
           //var ppth = new Path()
           //{
           //    Data = new RectangleGeometry()
           //    {
           //        Rect = new Rect(page.MediaMinX, page.MediaMinY, page.Width, page.Height),
           //    },
           //    Fill = new SolidColorBrush(PaperColor),
           //};
           //pageCanvas.Children.Remove(lbl_Watermark);
           //pageCanvas.Children.Remove(lblheader);
            
           //pageCanvas.Children.RemoveAt(0);
           //pageCanvas.Children.Insert(0, ppth);
           //pageCanvas.Children.Remove(rect);
           //pageCanvas.Children.Remove(lbl_footer);
 
           //pageCanvas.Children.Remove(c);
            
           ReloadState();
 
       }
 
       private void ReloadState()
       {
           IsolatedStorageProvider isoStorageProvider = new IsolatedStorageProvider();
           isoStorageProvider.LoadFromStorage();
      
        
       }       
               
       ///


Could you please let me know the apprach.


Thanks,
vivek.








 

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 10 Aug 2011, 07:59 AM
Hello Vivek,

I am not sure exactly what control you are trying to persist or which properties. Is it possible to provide us with a sample or more detailed information on this so that we can look into it? Please note that the PersistenceFramework saves only the UI-related properties of the elements.

Kind regards,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
PersistenceFramework
Asked by
Vivek
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or