private void UserControl_Loaded(object sender, RoutedEventArgs e) { u = new Person(); //IsolatedStorageSettings.ApplicationSettings["User"] = ""; //IsolatedStorageSettings.ApplicationSettings["Answered"] = ""; Answered = ((IsolatedStorageSettings.ApplicationSettings["Answered"] != null)&&(IsolatedStorageSettings.ApplicationSettings["Answered"].ToString()!=String.Empty)); if (IsolatedStorageSettings.ApplicationSettings["User"] != null) { userXML = IsolatedStorageSettings.ApplicationSettings["User"].ToString(); } if (userXML != String.Empty) { setUser(); } }
void setUser() { try { XDocument xmlFeed = XDocument.Parse(userXML); u = (from gs in xmlFeed.Descendants("Person") select new Person { UserID = new Guid(gs.Element("UserID").Value), Name = gs.Element("Name").Value }).Single(); ShowQuestions(); } catch { } }