public async override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            //Refresh the note on the screen
            CurrNote = await NoteDatabase.GetNoteByIdFromLocal(CurrNote.Id);

            UpdateView();
            _isrunning = true;
        }
Example #2
0
        /// <summary>
        /// Called when a row is touched
        /// </summary>
        public async override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            //UIAlertController okAlertController = UIAlertController.Create(tableItems[indexPath.Row].Title, tableItems[indexPath.Row].Content, UIAlertControllerStyle.Alert);
            //okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
            var detailController = new NoteDetailViewController(await NoteDatabase.GetNoteByIdFromLocal(_tableItems[indexPath.Row].Id));

            _owner.NavigationController.PushViewController(detailController, true);

            tableView.DeselectRow(indexPath, true);
        }
        public async void StayUpdated()
        {
            while (_isrunning)
            {
                Thread.Sleep(5000);
                CurrNote = await NoteDatabase.GetNoteByIdFromLocal(CurrNote.Id);

                InvokeOnMainThread(() =>
                {
                    //CurrNote =  NoteDatabase.GetNoteById(CurrNote.Id);
                    UpdateView();
                });
            }
        }