Exemple #1
0
        public async Task EditCategoryAsync()
        {
            AddEditCategoryDialog dialog = new AddEditCategoryDialog(new AddEditCategoryDialogViewModel());

            dialog.ViewModel.CategoryTitle = selectedItemGroup.Title;
            ContentDialogResult result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                selectedItemGroup.Title = dialog.ViewModel.CategoryTitle;
                _contentProviderApiService.SaveData();
            }
        }
Exemple #2
0
        public async Task AddCategoryAsync()
        {
            AddEditCategoryDialog dialog = new AddEditCategoryDialog(new AddEditCategoryDialogViewModel());
            ContentDialogResult   result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                var itemGroup = new ItemGroup(dialog.ViewModel.CategoryTitle);
                _contentProviderApiService.AddItemGroup(itemGroup);

                ItemGroups.Add(itemGroup);
            }
        }