private async void Button_Click(object sender, RoutedEventArgs e) { MoveNameString = m_oMoveName.Text; //TODO: Check for valid names if (!m_oValidNameRegex.IsMatch(MoveNameString)) { MessageDialog oDialog = new MessageDialog("Invalid name. Please enter a character starting with a letter, and containing only alphanumeric characters plus spaces."); oDialog.Commands.Add(new UICommand("OK")); await oDialog.ShowAsync(); } else { if (MoveList.MoveListCollection.Select(oMove => oMove.Name).Contains(MoveNameString)) { MessageDialog oDialog = new MessageDialog("This name already exists. Please choose a unique name."); oDialog.Commands.Add(new UICommand("OK")); await oDialog.ShowAsync(); } else { await MoveList.FindMove(MoveNameString); Frame.Navigate(typeof(QRCameraPage)); } } }
private async void YesDeleteCommandInvokedHandler(IUICommand command) { if (m_oMoveList.Items.Count > 0 && m_oMoveList.SelectedIndex != -1) { await MoveList.DeleteCurrentMove(); m_oMoveList.ItemsSource = null; m_oMoveList.ItemsSource = MoveList.MoveListCollection; m_oMoveList.SelectedItem = null; } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected override async void OnNavigatedTo(NavigationEventArgs e) { await MoveList.LoadFolders(); m_oMoveList.ItemsSource = MoveList.MoveListCollection; }