예제 #1
0
        private void ConfirmButton_Click(object sender, EventArgs e)
        {
            string todoName = TodoName.Text;
            string todoRemarks = TodoRemarks.Text;
            DateTime todoDeadline = (DateTime)TodoDeadline.Value;

            // create a new to-do item
            Todo newTodo = new Todo(todoName, todoRemarks, todoRelatedAnnouncement.announceNameDisplay, todoRelatedAnnouncement.announceContentDisplay, todoDeadline, (Application.Current as App).announcement.announceModuleCode);

            // add the new to-do item onto the list
            (Application.Current as App).todos.Add(newTodo);
            (Application.Current as App).UpdateAppTile();

            MessageBox.Show("To-do item added successfully");

            IsoStoreHelper.SaveContent("todo", (Application.Current as App).todos, typeof(List<Todo>));

            // return back to the announcement page
            NavigationService.GoBack();
        }
예제 #2
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // loading existing data for info page and announcement page
            base.OnNavigatedTo(e);

            int todoIndex = 0;
            string index = "";

            if (NavigationContext.QueryString.TryGetValue("todoIndex", out index))
            {
                todoIndex = Convert.ToInt32(index);
            }

            selectedTodo = (Application.Current as App).todos[todoIndex];

            TodoNameTitle.Text = selectedTodo.todoName;
            name.Text = selectedTodo.todoName;
            details.Text = selectedTodo.todoDetail;
            deadline.Text = selectedTodo.todoDeadlineDisplay;
            announceName.Text = selectedTodo.todoRelatedAnnounceName;
            announceDetail.Text = selectedTodo.todoRelatedAnnounceContent;
        }