private async void OnAddPersonGroupButtonClicked(object sender, RoutedEventArgs e) { try { if (string.IsNullOrEmpty(SettingsHelper.Instance.WorkspaceKey)) { throw new InvalidOperationException("Before you can create groups you need to define a Workspace Key in the Settings Page."); } Guid personGroupGuid = Guid.NewGuid(); await FaceServiceHelper.CreateLargePersonGroupAsync(personGroupGuid.ToString(), this.personGroupNameTextBox.Text, SettingsHelper.Instance.WorkspaceKey); LargePersonGroup newGroup = new LargePersonGroup { Name = this.personGroupNameTextBox.Text, LargePersonGroupId = personGroupGuid.ToString() }; this.PersonGroups.Add(newGroup); this.personGroupsListView.SelectedValue = newGroup; this.personGroupNameTextBox.Text = ""; this.addPersonGroupFlyout.Hide(); this.needsTraining = true; } catch (Exception ex) { await Util.GenericApiCallExceptionHandler(ex, "Failure creating group"); } }