예제 #1
0
        /// <summary>
        ///     This event is fired when a context menu action for an item is selected (Complete/Postpone).
        /// </summary>
        private void TaskListContextMenuClick(string menuItem, Task task)
        {
            // now that we have the associated task, we can take action on it.
            if (menuItem == "Complete")
            {
                task.Complete(() =>
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        IsLoading = false;
                    });

                    sReload = true;
                    LoadData();
                });
            }
            else if (menuItem == "Postpone")
            {
                task.Postpone(() =>
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        IsLoading = false;
                    });

                    sReload = true;
                    LoadData();
                });
            }
        }
예제 #2
0
 /// <summary>
 ///     This event is fired when a context menu action for an item is selected (Complete/Postpone).
 /// </summary>
 private void TaskListContextMenuClick(string menuItem, Task task)
 {
     // now that we have the associated task, we can take action on it.
     if (menuItem == "Complete")
     {
         task.Complete(() =>
         {
             // Task was marked as complete, just remove it from the list.
             Dispatcher.BeginInvoke(() =>
             {
                 CurrentTag.Tasks.Remove(task);
             });
         });
     }
     else if (menuItem == "Postpone")
     {
         task.Postpone(() =>
         {
         });
     }
 }