Ejemplo n.º 1
0
        async void ExecuteNavigateToDetail(ToDoDetailModel item)
        {
            NavigationParameters p = new NavigationParameters();

            p.Add("toDo", item);
            await _navigationService.NavigateAsync("ToDoDetailPage", p);
        }
        public void OnNavigatedFrom(INavigationParameters parameters)
        {
            ToDoDetailModel toDo = new ToDoDetailModel(_id, _detail, _striked);

            toDo.CreationDate = CreationDate;
            toDo.ModifiedDate = _detail == OriginalDetail ? ModifiedDate : DateTime.Now.ToString();
            parameters.Add("toDo", toDo);
        }
Ejemplo n.º 3
0
        void ExecuteStrike(ToDoDetailModel item)
        {
            string          textDecoration = item.Striked == "Strikethrough" ? "None" : "Strikethrough";
            ToDoDetailModel toDoUpdate     = new ToDoDetailModel(item.Id, item.Detail, textDecoration);

            toDoUpdate.CreationDate = item.CreationDate;
            toDoUpdate.ModifiedDate = DateTime.Now.ToString();
            _getRealmInstance.Write(() => {
                _getRealmInstance.Add(toDoUpdate, update: true);
            });
        }
        public void OnNavigatedTo(INavigationParameters parameters)
        {
            ToDoDetailModel toDo = parameters["toDo"] as ToDoDetailModel;

            Id             = toDo.Id;
            Detail         = toDo.Detail;
            OriginalDetail = toDo.Detail;
            Striked        = toDo.Striked;
            StrikeDetail   = Striked == "Strikethrough" ? "Completed" : "Ongoing";
            CreationDate   = toDo.CreationDate;
            ModifiedDate   = toDo.ModifiedDate;
        }
Ejemplo n.º 5
0
        void ExecuteDelete(ToDoDetailModel item)
        {
            ToDoDetailModel toDo = _getRealmInstance.All <ToDoDetailModel>().First(x => x.Id == item.Id);

            using (Transaction transaction = _getRealmInstance.BeginWrite())
            {
                _getRealmInstance.Remove(toDo);
                transaction.Commit();
            }

            ToDos.Remove(item);
        }
Ejemplo n.º 6
0
        public override void OnNavigatedTo(INavigationParameters parameters)
        {
            NavigationMode navigationMode = parameters.GetNavigationMode();

            if (navigationMode == NavigationMode.Back)
            {
                ToDoDetailModel toDoUpdate = parameters["toDo"] as ToDoDetailModel;
                _getRealmInstance.Write(() => {
                    _getRealmInstance.Add(toDoUpdate, update: true);
                });
            }
        }
Ejemplo n.º 7
0
        void ExecuteAdd()
        {
            ToDoDetailModel toDo = new ToDoDetailModel();

            toDo.Id           = Guid.NewGuid().ToString();
            toDo.Detail       = Detail;
            toDo.CreationDate = DateTime.Now.ToString();
            toDo.ModifiedDate = DateTime.Now.ToString();
            _getRealmInstance.Write(() => {
                _getRealmInstance.Add(toDo);
            });
            ToDos.Add(toDo);
        }