Xaml cannot create an instance of “X”

This is because instantiating ApplicationsSettings throws an exception. If you add the following to your constructor, you should be fine;

try { settings = IsolatedStorageSettings.ApplicationSettings; } catch (System.IO.IsolatedStorage.IsolatedStorageException e) { // handle exception }


这是因为有可能出现异常,需要在构造函数中作出判断,抛出异常。

你可能感兴趣的:(instance)