Пример #1
0
        private async void MoreInputPage_Disappearing(object sender, EventArgs e)
        {
            MoreInputNeeded page = (MoreInputNeeded)sender;

            if (page.UserChoice == DataContracts.Enums.UserChoice.Create)
            {
                DataContracts.Entry entry = new DataContracts.Entry();
                entry.Value   = page.ExtraValue;
                entry.Created = DateTime.Now;

                if (page.ForEntryType.Entries == null)
                {
                    page.ForEntryType.Entries = new List <DataContracts.Entry>();
                }
                page.ForEntryType.Entries.Add(entry);

                await SaveToDisk(EntryTypes);
            }
            else if (page.UserChoice == DataContracts.Enums.UserChoice.Delete)
            {
                EntryTypes.Remove(page.ForEntryType);

                RefreshData();
            }

            return;
        }
Пример #2
0
        async private void Button_Clicked(object sender, EventArgs e)
        {
            MoreInputNeeded moreInputPage = new MoreInputNeeded(EntryTypes.First(n => n.Name == ((Button)sender).Text));

            moreInputPage.Disappearing += MoreInputPage_Disappearing;
            await Navigation.PushModalAsync(moreInputPage);
        }