private void TextBlock_CharacterReceived(UIElement sender, Windows.UI.Xaml.Input.CharacterReceivedRoutedEventArgs args) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 6)) { nvSample.PaneTitle = ((TextBox)sender).Text; } }
/// <summary> /// Fired when a character received /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void CustomPasswordBox_CharacterReceived(UIElement sender, Windows.UI.Xaml.Input.CharacterReceivedRoutedEventArgs args) { if (!char.IsDigit(args.Character)) { return; } AddToSecureString(args.Character.ToString()); args.Handled = true; }
private void QuickAddTextbox_CharacterReceived(UIElement sender, Windows.UI.Xaml.Input.CharacterReceivedRoutedEventArgs args) { if (parser != null) { Filter = parser.Parse(QuickAddTextbox.Text); quickaddItems.Clear(); foreach (var item in Filter) { quickaddItems.Add(item); } RedoTodos(); } }
//Display error msg if user enters non-numerical characters private void PatientPercentBurnTxt_CharacterReceived(UIElement sender, Windows.UI.Xaml.Input.CharacterReceivedRoutedEventArgs args) { if (!char.IsControl(args.Character) && !char.IsDigit(args.Character) && (args.Character != '.')) { args.Handled = true; PatientBurnInputErrorTxt.Opacity = 100; IsInvalidEntry = true; } else { PatientBurnInputErrorTxt.Opacity = 0; IsInvalidEntry = false; } }