async System.Threading.Tasks.Task LoadTasksAsync()
        {
            try
            {
                var tasks = await _tasksService.GetTasksAsync();

                TableView.BackgroundColor = UIColor.FromRGB(248, 248, 248);
                TableView.TableHeaderView = GetViewForHeader();
                TableView.DataSource      = new TaskTableDataSource(tasks);
                TableView.Delegate        = new TaskTableDelegate(this, tasks);
                TableView.RowHeight       = TaskTableViewCell.CellHeight;
                TableView.SeparatorColor  = UIColor.Clear;
                TableView.ReloadData();

                NavigationItemHelper.UpdateBadgeCounter(
                    NavigationItem,
                    tasks.Count(r => !r.Resolved));
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"[Suggestions] Error: {ex}");
                await _dialogService.ShowAlertAsync("Error retrieving data", ex.Message, "Ok");
            }
            finally
            {
                _loading.Hide();
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItemHelper.UpdateBadgeCounter(NavigationItem, 0);
            NavigationController.NavigationBar.AddGestureRecognizer(_titleTapGestureRecognizer);
        }
Exemple #3
0
        void OnTaskMarkedAsResolved(DetailViewModel vm)
        {
            _currentBadgeCount--;

            NavigationItemHelper.UpdateBadgeCounter(
                _detailViewController.NavigationItem,
                _currentBadgeCount);
            NavigationItemHelper.UpdateBadgeCounter(
                _parentController.NavigationItem,
                _currentBadgeCount);
        }
Exemple #4
0
        public void ShowFormsDetailPage(Models.Task task, int currentBadgeCount)
        {
            _currentBadgeCount = currentBadgeCount;

            _detailViewController = new DetailView(task).CreateViewController();

            _navigationController.PushViewController(_detailViewController, true);
            NavigationItemHelper.UpdateBadgeCounter(
                _detailViewController.NavigationItem,
                currentBadgeCount);
        }