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

The attachable property 'StorageId' was not found in type 'PersistenceManager'

2 Answers 314 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Yan
Top achievements
Rank 1
Yan asked on 24 Feb 2015, 07:41 PM
I am adding Telerik's PersistenceFramework to an exist WPF/MVVM project (WPF with MVVM).  Version is 2013.1.0403.  I am adding a new feature to save Window and controls' settings and reload them application is reopened.  I added PersistenceManager reference using same version of 2013.1.0403.  

<telerik:RadRibbonWindow x:Class="Corning.Eln.Views.AppView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:elnViews="clr-namespace:Corning.Eln.Views"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Background="White"
Height="600" Width="840"
Closing="RadRibbonWindow_Closing" Activated="RadRibbonWindow_Activated" telerik:PersistenceManager.StorageId="myRadRibbon">

I added following to my .xaml.cs and no error message:

using Telerik.Windows.PersistenceFramework;
using Telerik.Windows.Persistence.Storage;
...
IsolatedStorageProvider isoProvider = new IsolatedStorageProvider();
isoProvider.LoadFromStorage();
...
IsolatedStorageProvider isoProvider = new IsolatedStorageProvider();
isoProvider.SaveToStorage();

But .xaml file get error on "telerik:PersistenceManager.StorageId="myRadRibbon".  The error message is "The attachable property 'StorageId' was not found in type 'PersistenceManager'.

Could anyone let me know why this happens?  Can I assign telerik:PersistenceFramework.StorageId to a RadRibbonWindows?

Thanks,
Yan

2 Answers, 1 is accepted

Sort by
0
Yan
Top achievements
Rank 1
answered on 25 Feb 2015, 03:24 PM
After I re-open .xaml file this morning and the error is "'StorageId' property was already registered by 'DependencyObject'.  What does this mean?  I have followed the code samples from telerik.com and don't know why this error comes out.

Thanks,
Yan
0
Martin Ivanov
Telerik team
answered on 26 Feb 2015, 08:41 AM
Hi Yan,

Yes, you can assign the PersistenceManager.StorageId property to any UI element. About the error, I am afraid without your setup I cannot be sure what is causing the issue. However, I can suggest you several things which you can try to resolve this:
  • The error can occur if the referenced Telerik assemblies do not match the target framework (.NET version) of the project. For example, if you reference the assemblies built under .NET 4.5 into a project that targets .NET 4 and then you try to define a Telerik control, Visual Studio will raise an error that claims that it cannot find it. The same (or a similar) issue can appear if there is a difference between the assemblies versions. Please double check if all referenced Telerik assemblies match the project's target framework and they are of the same version.
  • If you have had used a specific dll's version in your project and at some point you upgraded to another one and then build the project, Visual Studio's caching mechanism can preserve some of the old assemblies and use them instead the new ones. This also can lead to issues. You can try to manually delete the "bin" and "obj" folders from your project and then Rebuild and Clean it.

Please try those suggestions and let me know if they resolve the issue.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PersistenceFramework
Asked by
Yan
Top achievements
Rank 1
Answers by
Yan
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or