コード例 #1
0
        private async void OnSave()
        {
            Category newCategory = new Category()
            {
                Name    = Name,
                LastUse = DateTime.MinValue,
                Words   = new List <Word>()
            };

            foreach (string s in Words)
            {
                newCategory.Words.Add(new Word()
                {
                    Text = s
                });
            }

            await WordData.AddItemAsync(newCategory);

            // This will pop the current page off the navigation stack
            await Shell.Current.GoToAsync("..");
        }