private async void NewCategoryContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // Get combobox value ComboBoxItem typeItem = (ComboBoxItem)ContentDialogs.IconSelectionComboBox.SelectedItem; string icon = typeItem.Content.ToString(); Category category = new Category { Name = ContentDialogs.NewCategoryTextBox.Text, Icon = icon }; await FileManager.AddCategoryAsync(Guid.Empty, category.Name, category.Icon); // Show new category await FileManager.ShowCategoryAsync(FileManager.itemViewHolder.Categories.Last().Uuid); }
private async void NewCategoryContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // Get combobox value ComboBoxItem typeItem = (ComboBoxItem)ContentDialogs.IconSelectionComboBox.SelectedItem; string icon = typeItem.Content.ToString(); Category category = new Category { Name = ContentDialogs.NewCategoryTextBox.Text, Icon = icon }; await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => await FileManager.AddCategoryAsync(Guid.Empty, category.Name, category.Icon)); }