Example #1
0
 public static bool IsPermitted(Key inKey)
 {
     return(InputRules.IsDelOrBackspace(inKey) ||
            inKey == Key.Tab ||
            InputRules.IsNumberKey(inKey) ||
            InputRules.IsArrowKey(inKey));
 }
Example #2
0
 //stops people copy/pasting non-numbers in!
 private void NumberBoxTextChanged(object sender, TextChangedEventArgs e)
 {
     this.seriesSizeInput.Text = InputRules.SanitiseInput(this.seriesSizeInput.Text);
 }
Example #3
0
 //checks for numerical input
 private void NumberBoxPreviewKeyDown(object sender, KeyEventArgs e)
 {
     e.Handled = !InputRules.IsPermitted(e.Key);
 }