private void Window_Loaded(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog aList = new Microsoft.Win32.OpenFileDialog(); Nullable <bool> result = aList.ShowDialog(); if (result == true) { GiBaLunNote = aList.FileName; string[] lines = System.IO.File.ReadAllLines(GiBaLunNote); foreach (string line in lines) { string[] parts = line.Split('|'); DoDoList item = new DoDoList(); item.Day.Text = parts[0]; item.ItemName.Text = parts[1]; item.ItemPrice.Text = parts[2]; ToDoList.Children.Add(item); } } }
private void plus_MouseDown(object sender, MouseButtonEventArgs e) { DoDoList item = new DoDoList(); item.Delete += new EventHandler(Delete); ToDoList.Children.Add(item); }