Ejemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog bbb = new Microsoft.Win32.OpenFileDialog();

            Nullable <bool> result = bbb.ShowDialog();

            if (result == true)
            {
                homework2 = bbb.FileName;

                string[] lines = System.IO.File.ReadAllLines(homework2);

                foreach (string line in lines)
                {
                    string[] parts = line.Split('|');

                    no2 item = new no2();

                    item.Day.Text       = parts[0];
                    item.ItemName.Text  = parts[1];
                    item.ItemPrice.Text = parts[2];

                    ToDoList.Children.Add(item);
                }
            }
        }
Ejemplo n.º 2
0
        private void plus_MouseDown(object sender, MouseButtonEventArgs e)
        {
            no2 item = new no2();

            item.Delete += new EventHandler(Delete);

            ToDoList.Children.Add(item);
        }