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 }


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

posted on 2012-03-07 12:04  SUNJUNLIN  阅读(311)  评论(0编辑  收藏  举报

导航