Ejemplo n.º 1
0
        /* Handler for click on 'Not completed' button.
         */
        private void notCompletedButton_Click(object sender, RoutedEventArgs e)
        {
            tasksView.Opacity = 0;
            HideEmptyTextBlockIfNeeded();
            TaskDataSource taskDataSource = (TaskDataSource)App.Current.Resources["taskDataSource"];

            tasksView.ItemsSource = taskDataSource.NotCompletedTasks;
            if (((ObservableCollection <Kompitu.Data.Model.Task>)tasksView.ItemsSource).Count == 0)
            {
                showEmptyTextBlock(Messages.GetMsgValue(MessageKey.NOT_COMPLETED_EMPTY));
            }
            selectedTaskList = null;
            ShowTaskList.Begin();
        }
Ejemplo n.º 2
0
        /* Events handling */

        /* Handler for click on 'For today' button.
         */
        private void todaysButton_Click(object sender, RoutedEventArgs e)
        {
            tasksView.Opacity = 0;
            HideEmptyTextBlockIfNeeded();
            TaskDataSource taskDataSource = (TaskDataSource)App.Current.Resources["taskDataSource"];

            // call datasource to produce list of tasks for today
            tasksView.ItemsSource = taskDataSource.TodaysTasks;
            if (((ObservableCollection <Kompitu.Data.Model.Task>)tasksView.ItemsSource).Count == 0)
            {
                showEmptyTextBlock(Messages.GetMsgValue(MessageKey.TODAYS_EMPTY));
            }
            selectedTaskList = null;
            ShowTaskList.Begin();
        }
Ejemplo n.º 3
0
        /* Handler for click event on item of taskListsView.
         */
        private void taskListsView_ItemClick(object sender, ItemClickEventArgs e)
        {
            Kompitu.Data.Model.TaskList taskList = (Kompitu.Data.Model.TaskList)e.ClickedItem;

            /*if (editMode)
             * {
             *  await PopupEditWarningDialog();
             *  return;
             *
             * komentuje bo nie pamietam po co to bylo
             *  if (taskList.Tasks.Count != 0)
             *  {
             *      DisableTaskEditMode(taskList.Tasks[0]);
             *  }
             *  else
             *  {
             *      DisableTaskEditMode(null);
             *  }
             * } */
            //HideTaskList.Begin();
            tasksView.Opacity = 0;
            HideEmptyTextBlockIfNeeded();
            TaskDataSource taskDataSource = (TaskDataSource)App.Current.Resources["taskDataSource"];

            //this.tasksView.ItemsSource = taskList.Tasks;

            this.tasksView.ItemsSource = taskList.OrderedTasks;
            if (((ObservableCollection <Kompitu.Data.Model.Task>)tasksView.ItemsSource).Count == 0)
            {
                showEmptyTextBlock(Messages.GetMsgValue(MessageKey.LIST_EMPTY));
            }

            // this.selectedTask = null;
            ShowTaskList.Begin();
            this.selectedTaskList = taskList;
        }