2 using System.Collections.Generic;
6 using System.Windows.Controls;
7 using System.Windows.Documents;
10 using System.Windows.Media.Animation;
11 using System.Windows.Shapes;
12 using Microsoft.Phone.Controls;
17 public partial class ListPage : PhoneApplicationPage
19 public static Uri
URI =
new Uri(
"/ListPage.xaml", UriKind.Relative );
23 InitializeComponent();
26 private void buttonAddText_Click(
object sender, RoutedEventArgs e )
28 listBox.Items.Add( textBox.Text );
31 private void buttonClear_Click(
object sender, RoutedEventArgs e )
33 listBox.Items.Clear();
36 private void buttonLoad_Click(
object sender, RoutedEventArgs e )
40 textBox.Text =
"File not found!";
44 List<string> itemList =
DataStorage.
Instance.Load<List<string>>(
new List<string>(), textFileName.Text );
45 listBox.Items.Clear();
46 foreach (
string item
in itemList ) listBox.Items.Add( item );
49 private void buttonSave_Click(
object sender, RoutedEventArgs e )
51 List<string> itemList = listBox.Items.OfType<
string>().ToList<string>();
55 private void buttonDelete_Click(
object sender, RoutedEventArgs e )
static IsolatedStorageManager Instance
override void Delete(string fileName)
Poistaa tiedoston.
override bool Exists(string fileName)
Kertoo onko tiedosto tai hakemisto olemassa.
void Save(object obj, string fileName)