public async void LoadItemId(string itemId)
        {
            try
            {
                var item = await SocialerDataStore.GetPersonAsync(itemId);

                Id           = item.Id;
                Name         = item.Name;
                Note         = item.Note;
                Rating       = item.Rating;
                TargetRating = item.TargetRating;

                var events = await SocialerDataStore.GetEventsAsync(itemId);

                Events.Clear();
                foreach (var @event in events)
                {
                    Events.Add(@event);
                }
            }
            catch (Exception)
            {
                Debug.WriteLine("Failed to Load Item");
            }
        }
        private async void OnSave()
        {
            await SocialerDataStore.AddPersonAsync(new Person
            {
                Name         = Name,
                Note         = Note,
                Rating       = Rating,
                TargetRating = TargetRating,
            });

            await Shell.Current.GoToAsync("..");
        }
        private async void OnPersonDelete(object obj)
        {
            var confirmed =
                await Shell.Current.DisplayAlert("Delete?", "Do you want to delete this connection?", "Yes", "No");

            if (confirmed)
            {
                await SocialerDataStore.RemovePersonAsync(Id);
            }

            await Shell.Current.GoToAsync("..");
        }
示例#4
0
        private async void OnSave()
        {
            await SocialerDataStore.AddEventAsync(PersonId, new Event
            {
                Name         = Name,
                Note         = Note,
                Time         = Time,
                RatingChange = RatingChange,
            });

            await Shell.Current.GoToAsync("..");
        }
示例#5
0
        public async void LoadEventId(string itemId)
        {
            try
            {
                var item = await SocialerDataStore.GetEventAsync(itemId);

                Id           = item.Id;
                Name         = item.Name;
                Note         = item.Note;
                RatingChange = item.RatingChange;
            }
            catch (Exception)
            {
                Debug.WriteLine("Failed to Load Item");
            }
        }
示例#6
0
        async Task ExecuteLoadPeopleCommand()
        {
            IsBusy = true;

            try
            {
                People.Clear();
                var items = await SocialerDataStore.GetPersonsAsync();

                foreach (var item in items)
                {
                    People.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }