Hello, I am trying to save the value from a datepicker to IsolatedStorage but I am having a hard time...Ive tried to covert it to string and it still doesnt want to work, i also tried declaring a new string named it Date then converted it to string but same result...I tested my code with a textblock.text and it works fine....if anyone can help me out please do... here is my code
private void ButtonWeight_Click(object sender, System.Windows.RoutedEventArgs e)
using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
XDocument _doc = new XDocument();
XElement _myDate = new XElement(Convert.ToString(DatePicker1.Value));
XAttribute weight = new XAttribute("weight", TextBoxWeight.Text);
_doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), _myDate);
IsolatedStorageFileStream location = new IsolatedStorageFileStream(Convert.ToString(DatePicker1.Value) + ".weight", System.IO.FileMode.Create, storage);
System.IO.StreamWriter file = new System.IO.StreamWriter(location);
NavigationService.Navigate(new Uri("/Pages/SavedWeights.xaml", UriKind.Relative));
hi, i am just using the microsoft 7.1 toolkit....i am not getting any errors but when i launch my app it loads fine then i navigate to the page and when i enter a date and a value then hit the save button my application just quits...so to narrow down why this was happening what i did was i left everything the same but instead of reading in the value from the datepicker i used a textblock and it worked perfectly
i added a reference to the microsoft toolkit then added the name space
then used the datepicer as shown below
Do you have the code examples for this because I'm trying to do the same thing (store DatePicker) but it does not work. A little help could be great. Thank you.
wish i could help but i still cannot get it to work the way i want to either....no1 seems to know what is up....what exactly are you trying to do?